Fix flaky Postgres cursor test #21281
Merged
+45
−25
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?
Fixes a flaky test by scoping the queries we're filtering for to the specific test that's running. Previously this test could flake due to previously ran queries from other tests still existing in
pg_stat_activity
table as this cleanup happens on Postgres container async. This became more frequent of an issue after #21173 due to a new testtest_commenter_cursor_functionality
which has similar functionality goals oftest_integration_connection_with_commenter_cursor
but scoped to our connection_pool classes connections. Depending on the order that these tests ran we could see incorrect count of queries returning so the first result that we check against would be incorrect. Now we're only looking for queries specifically from this test execution runMotivation
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged