Skip to content

Wait for each tile's own encode in the content-interval test (851-4502) - #1511

Merged
pondorasti merged 2 commits into
mainfrom
alexandru/851-4502-screen-sharing-host-content-interval-test
Nov 27, 2026
Merged

pondorasti merged 2 commits into
mainfrom
alexandru/851-4502-screen-sharing-host-content-interval-test

Conversation

@pondorasti

@pondorasti pondorasti commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Fixes 851-4502

ScreenSharingV2HostContentIntervalTests.eachTileCarriesTheTimeSinceItsOwnContentChanged (from #1508) hung for its 60 s limit in one of four full ScreenSharingV2Tests runs. A hang there can turn main's Build red.

Cause

After pushing each frame, the test waited for encoder.requests.count + 1 encodes, reading the count after the push. When the host encoded the frame before that read, the target was one past the encode that was coming, so the wait never ended.

Forcing that order (waiting for the encode before reading the count) reproduces the failure exactly: the 60 s time limit, then encoder.requests.map(\.update.tiles) == [[0, 1], [0], [0], [1]] failing.

Fix

The test waits for the frame's own index (index + 1 encodes), so the order in which the push and the read land doesn't matter. It is the only test in the package that read its wait target after the trigger.

Proof

  • Under the forced order: fails before the fix, passes after.
  • ScreenSharingV2Tests: 13 full runs of 206 tests, all passed (M1 Pro, with timeouts).
  • swift:format:check and swift:lint.

Code review

One finding, fixed: if an encode never came, the time limit would end the wait and requests[index] would read past the end, crashing the whole test process. A #require now turns that into this test's failure.

Test-only change; nothing in the app changes.

🤖 Generated with Claude Code

pondorasti and others added 2 commits November 27, 2026 08:38
… past what was already recorded (851-4502)

The test read `encoder.requests.count + 1` after pushing the frame. When the host encoded the frame before that
read, the target was one past the encode that was coming, and the wait ran into the suite's 60 s limit (one in
four full ScreenSharingV2Tests runs). It now waits for the frame's own index, whichever order the two land in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@pondorasti
pondorasti merged commit 9b07735 into main Nov 27, 2026
11 checks passed
@pondorasti
pondorasti deleted the alexandru/851-4502-screen-sharing-host-content-interval-test branch November 27, 2026 17:13
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