Repository navigation
Run the simulator's timed faults on a clock the tests step - #396
Merged
Merged
Conversation
`interruptAfter` failed on a stalled runner: the fault's two 50 ms `Task.sleep`s ran on the wall clock, and the suite after it took 40x its usual time, so `interruptionEnded` missed the test's 3 s wait. `SimulatorAudioSource` now sleeps on an injected clock (the wall clock by default); the three timed-fault tests pass a `TestClock` and step it once each sleep has parked. The suite gets a one-minute limit, since `waitUntilSleeping` waits on it rather than on a timeout of its own. 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
SimulatorAudioSource's timed faults (interruptAfter,runtimeErrorAfter,routeChangeAfter) now sleep on an injectedany Clock<Duration>,ContinuousClock()by default. The three "Simulator faults" tests pass aTestClockand step it withwaitUntilSleeping+advance.Why
interruptAfter: taken, refused, given back — in that orderfailed on #383'sios-build(run), which doesn't touch this code. The runner stalled: the next suite, Command router, took 4.08 s against its usual 0.105 s. That pushed the fault's second 50 ms wall-clock sleep past the test's 3 s wait forinterruptionEnded.On the test clock, the fault fires when the test steps it, so a stall can't reorder anything.
routeChangeAfteralso stops depending on the watchdog event winning a 50 ms race. The suite runs in 0.013 s instead of 0.249 s, and gets a one-minute.timeLimitbecausewaitUntilSleepinghas no timeout of its own.Verification
scripts/ios-check.sh: 374 passed, BlurtiOSCore coverage 96.14%,swiftlint analyzeclean, periphery cleanscripts/check.sh --lint-only: ok🤖 Generated with Claude Code