Repository navigation
control both clocks in the chapter-selection hold test; widen the Findaway wait ceiling - #238
Merged
Merged
Conversation
test_chapterSelection_holdsDisplayedLocationAgainstTheTrackBeingLeft slept 1.6 s for the skip-suppression window to lapse and then expected the navigation hold to still be in force. The hold clears itself 3 s after the selection, so on ios-core's iOS 26.5 run 36931526869 (test duration 22.8 s) the hold had already cleared when the leaving track's tick arrived. AudiobookPlaybackModel now reads every suppression window through wallClock, which defaults to Date(), and takes the hold's fallback timeout from navigationHoldTimeout, which defaults to 3.0 s. The test advances the wall clock past the window and sets the timeout beyond the test, so only the target's own position can release the hold. Fixed sleeps after each emit are replaced by a main-queue drain.
testQueuedManipulation_runsAfterTheDebounceAndClearsTheQueuedState already waits on its condition rather than sleeping, but its 5 s ceiling was exceeded on toolkit run 36932958123 (10.9 s), where the 0.5 s debounced work item had not yet run. Both callers wait for an event that does occur, so the ceiling only decides how long a real hang takes to report.
mauricecarrier7
added a commit
to ThePalaceProject/ios-core
that referenced
this pull request
Oct 1, 2026
Picks up ThePalaceProject/ios-audiobooktoolkit#238. On iOS 26.5 the chapter-selection hold test's 3 s fallback expired before its ticks arrived, and on macos-15 a Findaway debounce wait exceeded its 5 s ceiling. #238 makes the first test independent of both clocks and raises the second ceiling to a 30 s hang bound.
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
AudiobookPlaybackModelTests.test_chapterSelection_holdsDisplayedLocationAgainstTheTrackBeingLeftdepended on two real timers:On ios-core's iOS 26.5 run 36931526869, which pins the toolkit at #237, the test took 22.8 s. The hold had already cleared when the leaving track's tick arrived, so
a tick from the track being left must not move the displayfailed. Elsewhere in that run,CursorTests.testPrevItemtook 15.7 s, so stalls of that length do happen on these runners.How
AudiobookPlaybackModelnow reads all of its suppression windows throughwallClock(added in make three timing-dependent tests assert behaviour instead of wall-clock bounds #237, defaultDate()). These are the save, transient-position and playback-poll windows.navigationHoldTimeout, which defaults to3.0.Verification
Executed 315 tests, with 1 test skipped and 0 failures.AudiobookPlaybackModeltest classes ran 10 iterations each: 230 executions, 0 failures.acceptPositionUpdatefails the first assertion.Also: Findaway
eventually()ceiling, 5 s to 30 sOn this PR's first CI run (36932958123),
FindawayPlayerAsyncContractTests.testQueuedManipulation_runsAfterTheDebounceAndClearsTheQueuedStatefailed after 10.9 s. That test is not touched by the change above.The test already waits on its condition rather than sleeping. Its 5 s ceiling ran out before the 0.5 s debounced work item had run, so this is a slow runner rather than a code fault. I raised the helper's default ceiling to 30 s and documented the reason in a comment. Both callers wait for an event that does happen, so a passing run still returns as soon as it does.
That class also ran 5 iterations locally: 115 executions, 0 failures.
Not done: this PR does not change the other wall-clock waits in the suite.