chore(asyncpg): fix flaky test_execute_after_patch_unpatch_patch#18199
Draft
quinna-h wants to merge 1 commit into
Draft
chore(asyncpg): fix flaky test_execute_after_patch_unpatch_patch#18199quinna-h wants to merge 1 commit into
quinna-h wants to merge 1 commit into
Conversation
Contributor
|
I can only run on private repositories. |
Contributor
|
Codeowners resolved as |
This file contains hidden or 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
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.
Description
Fixing
test_execute_after_patch_unpatch_patch[py3.10]• Questions? Ask in #code-gen-flaky-testsThis change stabilizes
test_execute_after_patch_unpatch_patchintests/contrib/asyncpg/test_asyncpg.py.The flaky failure (
'function' object has no attribute '__wrapped__') was categorized as order-dependent and was caused by the test using thepatched_connfixture, which creates the connection before the explicitunpatch()/patch()cycle being validated. That allowed prior test ordering and global asyncpg patch state transitions to influence this test's connection state.Changes
test_execute_after_patch_unpatch_patchto stop using thepatched_connfixture.unpatch()/patch()cycle inside the test.try/finallyblock.Testing
Risks
Low risk. The change is test-only and narrows scope to per-test local setup/cleanup, improving isolation without changing production behavior.
Additional Notes
None.
PR by Bits - View session in Datadog
Comment @DataDog to request changes