Conversation
The thread-pane tests in seenOnSight.test.tsx waited in real time for the one-second dwell and the 250 ms recheck. The sheet test's waits add up to about 4.9 s against bun's 5 s default timeout, so on a loaded CI runner it timed out (main runs 38335172993 and 38329767152). The tests now run on bun's fake timers: wait() advances the test's clock, and setImmediate lets fetch replies and effects settle between steps. Same steps, same assertions; the file takes about 0.5 s instead of 26 s.
…ob timeout afterEach puts real timers back in a finally, so fake timers never leak into a later file. wait() notes that a real timer must never be awaited under fake timers. The test job gets timeout-minutes: 45 (green runs take 16-19 minutes): bun's per-test timeout cannot fire under fake timers, so a stuck await would otherwise idle until GitHub's 6-hour default.
1 task
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.
Why
Main's Test workflow ("Run UI seam-contract + DOM tests") went red on a74742f (run 38335172993) and be0b1fa (run 38329767152). Both times the failure was the same test, "something drawn over the first lines (a sheet) hides them: nothing is seen until it goes, and a cover mid-dwell restarts it", which timed out after 5000 ms and then timed out again on retry.
The cause: the thread-pane tests in
packages/inbox/seenOnSight.test.tsxwaited in real time for the one-second dwell and the 250 ms recheck. The waits in the sheet test add up to about 4.9 s, so there was about 100 ms of room under bun's 5 s default. A slower runner went past it. On my machine,--timeout 4900makes it fail every time. The ECONNREFUSED lines near it in the log come from other test files, not this one.What changed (test only, no product change)
jest.useFakeTimers()inbeforeEach,useRealTimers()inafterEach).wait(ms)now advances the test's clock withjest.advanceTimersByTime(ms). Before and after that, it waits onesetImmediateturn, which the fake timers do not replace, so fetch replies and effects can settle.Proof
DOM_TESTS=1 bun test packages/inbox/seenOnSight.test.tsx: all 22 tests passed each time.yesloops) and--timeout 2000: all passed.--isolate): 1817 pass, 0 fail.