Repository navigation
test(zero-swift): count the busy main actor's time in slices when sending - #131
Merged
Merged
Conversation
…ding URLSessionTransportTests.sendsWhileTheMainActorIsBusy failed on main's iOS Simulator job at a6e11db with 2 of 200 frames. The whole test process stalled for about 20 s then: consecutive Network.framework steps of one connection logged 8 s and 10 s apart, and virtual list tests that don't touch the network took 14 to 26 s. The main actor's usleep(1 s) ran out during the stall, and the check ran before the frames' writer, stalled with it, could catch up. The main actor now stays busy for 100 slices of 10 ms, the same second, or until the frames are out, so a stall stretches one slice. Stopping the test process for 3 s during the wait failed the test 3 of 3 times before (85, 114 and 110 frames) and passes it 3 of 3 times now. With the writer back on the main actor, as before #107, it still fails with no frames. Amp-Thread-ID: https://ampcode.com/threads/T-0d2ed206-a5dd-4f42-9b68-c56e6b23e8f6 Co-authored-by: tmm <tmm@tmm.dev>
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.
Fixes the
URLSessionTransportTests.sendsWhileTheMainActorIsBusyflake on main's iOS Simulator job at a6e11db (job), where only 2 of 200 frames arrived.Cause. The whole test process stalled for about 20 s, and the check ran as the stall ended:
usleep(1 s)ran out during the stall, so the check ran before the frames' writer, which had stalled too, could catch up.This isn't a transport bug: a writer on the main actor gets 0 frames out, and 2 got out.
Change. The main actor stays busy for 100 slices of 10 ms (the same 1 s budget) or until the frames are out, so a stall stretches only one slice.
Verification (iOS 26.2 simulator):
URLSessionTransportTests, 5 iterationsTest-only, so no changeset.