Repository navigation
test(computers): two recording tests wait for what they check instead of racing it - #853
Merged
Merged
Conversation
… of racing it The browser recording test that follows a popup waits until the video has taken a frame of each tab's colour, not a fixed 0.3 s, which a slow frame decode on a loaded runner outlasted, so no red frame was recorded. The annotated recording test whose mark can't be made fails the mark itself rather than the display read, which the recording's own captures could take first, leaving the scroll marked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ot just taken The video takes a frame only once it has encoded the one before, so a frame taken after a colour's first proves that one encoded; ending the recording sooner could cancel its last frame mid-conversion. 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.
What and why
Two unit tests failed on #844's CI runs and passed on rerun. Neither failure came from that change; each was a race
in the test.
test_browser_recording.py::test_the_video_follows_an_agents_tab_a_popup_it_opens_and_goes_back_when_that_closeskept the popup (red) open for a fixed 0.3 s. On a loaded runner a frame decode can take longer, so the 10 fps video
took no red frame and the colour check failed.
test_computer_recording_annotate.py::test_an_input_goes_ahead_when_its_mark_cant_be_mademade the fake's nextdisplay read fail, expecting the scroll's mark to be the one that reads it. The recording's own capture loop also
reads the display at 10 fps and could take the failure first, so the scroll was marked.
What changes
before it moves on, with a 10 s limit, instead of fixed sleeps. It notes the frames by wrapping the stream's
_latest, which the video calls for each frame. The video takes a frame only once it has encoded the one before,so a colour is encoded once the frame after its first has been taken.
annotate.input_marksraises) instead of the shared display read. Itstill goes through the same best-effort
exceptinComputerRuntime._annotate.Tests only.
How it was checked
Each race made to happen on purpose, by running both versions of each test with a slowdown that a loaded runner causes:
Both files pass (58 tests), and each test passed 40 times in a row under twelve CPU busy loops.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Two recording tests replace timing races with checks tied to the work they need.
The earlier last-frame finding is fixed: the next sample cannot arrive until the previous frame finishes encoding. No new actionable issues were found. Tests were not run during this review.
Reviews (5) · Last reviewed commit: "test(computers): the popup test waits un..." · Reviewed by Greptile