Repository navigation
test(android): read the generation diagnostic's reconnect stably; report USB state when a reconnect wait times out - #1045
Merged
Conversation
…ort USB state when a reconnect wait times out PR #1039 head 13008d8 (Android tree = 5c4abf6) timed out in test_usb_reconnect_generation_diagnostics.py:51 and test_usb_reconnect_late_observation.py:41. Line 51 waited for exactly two forward rows. On 5c4abf6 the ended first request still re-acquired a third row once the second request's entry ended (fixed in #1044), so a late first look could never succeed. Read the first two rows once at least two exist; the old-id and second-request assertion is unchanged. Both waits now add bounded synthetic state to their timeout message: forward rows by request role, USB entries, ended requests, runs, retained handles and fake ADB call counts. No other assertion, deadline or name changes. Spec: ANYM-997 Signed-off-by: egerev <egor@gosync.ai> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
PR #1039 head 13008d8 failed
checks / services(job 134763565627, run 44293197960) in the two #1042 tests:test_usb_reconnect_generation_diagnostics.py:51andtest_usb_reconnect_late_observation.py:41, both "bounded synthetic supervision did not finish". That head's Android tree is exactly 5c4abf6, which has #1042 but not #1044.Line 51, mechanism proven on that source. The wait required exactly two forward rows. Traced on 5c4abf6, the ended first request re-acquires a third row about 0.12 s after the second request finishes; #1044 fixed that defect. With a lifecycle barrier (first read only once a third row exists), the original predicate fails every time on 5c4abf6, and the new predicate passes and still asserts the second request's row. The captured state at that failure:
[('first','closed',…,'collection_superseded'), ('second','closed','confirmed'), ('first','owned','unconfirmed')]. On current main the first request is refused and the table stays at two rows. The historical CI run has no state dump, so its exact timing is unknown.Line 41, cause unknown. Traced on 5c4abf6, this test's third row also came from the ended first request (the #1044 defect path), not from the third request. On main it comes from the third request. With that request held for 10 supervision ticks before admission, it still acquires and the test passes. No local run reproduced the CI timeout, so its interleaving remains unknown. This PR adds the state capture needed next time.
Change (two test files only)
len(r) >= 2, returningr[:2].old['id'] == lost['id'] and new['request_id'] == secondis unchanged.until_or_state, which appends bounded synthetic state to the timeout message: forward rows by request role (first/second/third, no ids), USB entries, ended requests, runs, retained handles and fake ADB call counts.Validation. Line-51 proofs on 5c4abf6, out of tree. The 58 USB tests pass on this tree, and Ruff is clean. Source and synthetic only.
Spec: ANYM-997
Change path: AUTO (test robustness and failure observability; no product code)
Review record: none (owner 11-11: no reviews)
🤖 Generated with Claude Code