Skip to content

test(browser): the nudge test times the second capture from before the frame, not from the first capture - #675

Closed
earakely-scale wants to merge 1 commit into
mainfrom
edgararakelyan/flaky-nudge-timing
Closed

earakely-scale wants to merge 1 commit into
mainfrom
edgararakelyan/flaky-nudge-timing

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

test_a_tab_behind_the_active_one_is_framed_once_a_second_capture_nudges_it checked that the second capture came at least NUDGE_S (0.5 s) after the first. It failed on #673's unit (2/2) with 0.49966 s.

The cause: _nudged_capture starts the first capture with ensure_future and then arms asyncio.wait(..., timeout=NUDGE_S). The first capture's request goes out on the loop's next turn, a moment after the wait started, so the second capture can follow it by a hair under NUDGE_S. The control is right; the test measured from the wrong point. It now times the second capture from before the frame call, which the second capture can't precede by less than NUDGE_S.

Testing

Test Result
test_browser_recording.py, five times 18 passed each time

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

This test-only change appears safe to merge.

Summary

Updates the nudge test to measure the second capture from before frame, rather than from the first capture.

  • The nudge test measures the second capture from before framing starts.

Reviews (1) · Last reviewed commit: "test(browser): the nudge test times the ..." · Reviewed by Greptile

…e frame, not from the first capture

The control arms its NUDGE_S wait before its first capture's task sends it, so the first capture is sent a moment
after the wait starts and the second can follow it by a hair under NUDGE_S (0.49966 s on a loaded runner). Timing the
second from before the frame call is what the control promises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 13, 2026 22:28
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

Folded into #673 (commit ea4454d), where this flake showed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant