Repository navigation
Fix flaky topic reader reconnect test - #924
Open
duckduckduck1 wants to merge 2 commits into
Open
duckduckduck1 wants to merge 2 commits into
duckduckduck1 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #924 +/- ##
==========================================
+ Coverage 82.66% 82.68% +0.02%
==========================================
Files 99 99
Lines 12951 12950 -1
Branches 1268 1440 +172
==========================================
+ Hits 10706 10708 +2
+ Misses 1794 1790 -4
- Partials 451 452 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
A moderate test-cleanup issue remains because a timed-out waiter task is neither cancelled nor awaited, allowing pending work or unhandled errors during event-loop teardown.
1 open issue
What changed in this PR
This pull request stabilizes the flaky asynchronous topic reader reconnect test by removing retry timing variability, synchronizing mocked callbacks, and cleaning up the reconnector.
Changes:
- Sets the slow retry backoff duration to zero.
- Synchronizes error and message callbacks with an
asyncio.Event. - Closes the
ReaderReconnectorin afinallyblock.
Outstanding review comments:
- Explicitly cancel and await the
wait_message()task when polling times out. - Preserve the existing
idempotent=Trueandretry_cancelled=Trueretry settings while overriding only the backoff duration.
| File | Summary |
|---|---|
ydb/_topic_reader/topic_reader_asyncio_test.py |
Updates reconnect-test synchronization, retry settings, and cleanup handling; follow-up changes are needed for waiter-task cleanup and preserving existing retry flags. |
Review effort: Lite
Refactor wait_message handling to use asyncio task cancellation. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This branch has not been deployed
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.

Fixes #850
Summary
finallyblock to clean up after the test.Testing
tox -e py -- ydb/_topic_reader/topic_reader_asyncio_test.py::TestReaderReconnector::test_reconnect_on_repeatable_error— passed on Python 3.14.