-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DBM-2797] fix rate limited activity collection test case #15715
Merged
lu-zhengda
merged 1 commit into
master
from
zhengda.lu/fix-test_activity_collection_rate_limit
Aug 30, 2023
Merged
[DBM-2797] fix rate limited activity collection test case #15715
lu-zhengda
merged 1 commit into
master
from
zhengda.lu/fix-test_activity_collection_rate_limit
Aug 30, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmeunier28
approved these changes
Aug 29, 2023
lu-zhengda
deleted the
zhengda.lu/fix-test_activity_collection_rate_limit
branch
August 30, 2023 14:58
boluwaji-deriv
pushed a commit
to boluwaji-deriv/integrations-core
that referenced
this pull request
Aug 30, 2023
FlorentClarret
added a commit
that referenced
this pull request
Aug 31, 2023
#15629) * Revise postgresql.replication_delay to Function with Archive WAL-driven PostgreSQL Replica * modify query and also add changelog message * update master with branch * update master with branch * Add short hand for force env rebuild in test (#15716) * add short hand for force-env-rebuild * add changelog entry * styling * [Release] Update metadata (#15717) * [Release] Bumped postgres version to 14.2.1 (#15713) * Bump oracledb version (#15595) * Bump oracledb version * update reqs * update changelog * Mark one metric as optional (#15719) * Update the test environments (#15644) * Update the test environments * Apply suggestions from code review Co-authored-by: Ofek Lev <ofekmeister@gmail.com> * update metadata.csv --------- Co-authored-by: Ofek Lev <ofekmeister@gmail.com> * [DBM-2685] Fix explaining parameterized queries flood server logs (#15612) * check if query is parameterized before blindly explain then fail * update CHANGELOG * skip explain parameterized query test for pg version < 12 * fix rate limited activity collection test case (#15715) * [DBM-2734] fix test_snapshot_xmin for pg > 13 (#15718) * fix test_snapshot_xmin for pg > 13 * reorder the steps to first collect metrics * remove check.cancel() --------- Co-authored-by: Steven Yuen <steven.yuen@datadoghq.com> Co-authored-by: Andrew Zhang <andrew.zhang@datadoghq.com> Co-authored-by: vivek-datadog <131680079+vivek-datadog@users.noreply.github.com> Co-authored-by: Florent Clarret <florent.clarret@datadoghq.com> Co-authored-by: Ofek Lev <ofekmeister@gmail.com> Co-authored-by: Zhengda Lu <zhengda.lu@datadoghq.com>
lu-zhengda
added a commit
that referenced
this pull request
Sep 27, 2023
#15629) * Revise postgresql.replication_delay to Function with Archive WAL-driven PostgreSQL Replica * modify query and also add changelog message * update master with branch * update master with branch * Add short hand for force env rebuild in test (#15716) * add short hand for force-env-rebuild * add changelog entry * styling * [Release] Update metadata (#15717) * [Release] Bumped postgres version to 14.2.1 (#15713) * Bump oracledb version (#15595) * Bump oracledb version * update reqs * update changelog * Mark one metric as optional (#15719) * Update the test environments (#15644) * Update the test environments * Apply suggestions from code review Co-authored-by: Ofek Lev <ofekmeister@gmail.com> * update metadata.csv --------- Co-authored-by: Ofek Lev <ofekmeister@gmail.com> * [DBM-2685] Fix explaining parameterized queries flood server logs (#15612) * check if query is parameterized before blindly explain then fail * update CHANGELOG * skip explain parameterized query test for pg version < 12 * fix rate limited activity collection test case (#15715) * [DBM-2734] fix test_snapshot_xmin for pg > 13 (#15718) * fix test_snapshot_xmin for pg > 13 * reorder the steps to first collect metrics * remove check.cancel() --------- Co-authored-by: Steven Yuen <steven.yuen@datadoghq.com> Co-authored-by: Andrew Zhang <andrew.zhang@datadoghq.com> Co-authored-by: vivek-datadog <131680079+vivek-datadog@users.noreply.github.com> Co-authored-by: Florent Clarret <florent.clarret@datadoghq.com> Co-authored-by: Ofek Lev <ofekmeister@gmail.com> Co-authored-by: Zhengda Lu <zhengda.lu@datadoghq.com>
3 tasks
lu-zhengda
added a commit
that referenced
this pull request
Sep 28, 2023
#15925) * Revise postgresql.replication_delay to Function with Archive WAL-driv… (#15629) * Revise postgresql.replication_delay to Function with Archive WAL-driven PostgreSQL Replica * modify query and also add changelog message * update master with branch * update master with branch * Add short hand for force env rebuild in test (#15716) * add short hand for force-env-rebuild * add changelog entry * styling * [Release] Update metadata (#15717) * [Release] Bumped postgres version to 14.2.1 (#15713) * Bump oracledb version (#15595) * Bump oracledb version * update reqs * update changelog * Mark one metric as optional (#15719) * Update the test environments (#15644) * Update the test environments * Apply suggestions from code review Co-authored-by: Ofek Lev <ofekmeister@gmail.com> * update metadata.csv --------- Co-authored-by: Ofek Lev <ofekmeister@gmail.com> * [DBM-2685] Fix explaining parameterized queries flood server logs (#15612) * check if query is parameterized before blindly explain then fail * update CHANGELOG * skip explain parameterized query test for pg version < 12 * fix rate limited activity collection test case (#15715) * [DBM-2734] fix test_snapshot_xmin for pg > 13 (#15718) * fix test_snapshot_xmin for pg > 13 * reorder the steps to first collect metrics * remove check.cancel() --------- Co-authored-by: Steven Yuen <steven.yuen@datadoghq.com> Co-authored-by: Andrew Zhang <andrew.zhang@datadoghq.com> Co-authored-by: vivek-datadog <131680079+vivek-datadog@users.noreply.github.com> Co-authored-by: Florent Clarret <florent.clarret@datadoghq.com> Co-authored-by: Ofek Lev <ofekmeister@gmail.com> Co-authored-by: Zhengda Lu <zhengda.lu@datadoghq.com> * update changelog * update changelog * update changelog * remove duplicate changelog entry * update changelog --------- Co-authored-by: boluwaji-deriv <97861462+boluwaji-deriv@users.noreply.github.com> Co-authored-by: Steven Yuen <steven.yuen@datadoghq.com> Co-authored-by: Andrew Zhang <andrew.zhang@datadoghq.com> Co-authored-by: vivek-datadog <131680079+vivek-datadog@users.noreply.github.com> Co-authored-by: Florent Clarret <florent.clarret@datadoghq.com> Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR fixes the flakey test
test_activity_collection_rate_limit
.The test relies on
time.sleep(sleep_time)
to run the activity collection for certain period of time and then uses thesleep_time
to calculate the maximum possible metrics to be collected during this time period.The reason why the test sometimes fails is because
check.cancel()
cancels a list of checks one by one. By the time it successfully cancels_query_activity
, the collection of the metrics might run slightly over thesleep_time
, causing the number of metrics collected exceed the maximum number we are expecting.The change is to calculate the expected
max_collections
based ontime_elapsed
. This way it provides a more accurate view of how much time the check has been running.Motivation
More robust logic in calculating the expected
max_collections
to prevent tests fails intermittently.Additional Notes
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.