Skip to content

test(android): read the generation diagnostic's reconnect stably; report USB state when a reconnect wait times out - #1045

Merged
egerev merged 1 commit into
mainfrom
bb/usb-reconnect-observability-thr_ngb3g9karf
Nov 18, 2026
Merged

egerev merged 1 commit into
mainfrom
bb/usb-reconnect-observability-thr_ngb3g9karf

Conversation

@egerev

@egerev egerev commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

PR #1039 head 13008d8 failed checks / services (job 134763565627, run 44293197960) in the two #1042 tests: test_usb_reconnect_generation_diagnostics.py:51 and test_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)

  • Line 51: len(r) >= 2, returning r[:2]. old['id'] == lost['id'] and new['request_id'] == second is unchanged.
  • Both waits go through 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.
  • The late test keeps its request ids for those labels.
  • No other assertion, deadline, parameter or test name changes.

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

…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>
@egerev egerev added the ship Small-fix rule: orchestrator Diff read at head; merge-keeper may enqueue label Nov 18, 2026
@egerev
egerev added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 128f7cc Nov 18, 2026
31 checks passed
@egerev
egerev deleted the bb/usb-reconnect-observability-thr_ngb3g9karf branch November 18, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ship Small-fix rule: orchestrator Diff read at head; merge-keeper may enqueue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant