Skip to content

mac tests: waitUntil throws, helper-exit bound logs instead of failing, carried-hold release tests (#809) - #812

Merged
d-q222 merged 1 commit into
mainfrom
fix/809-test-wait-hardening
Sep 17, 2026
Merged

d-q222 merged 1 commit into
mainfrom
fix/809-test-wait-hardening

Conversation

@d-q222

@d-q222 d-q222 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #809, items 1–3. Item 4 (stale completion ordering, pre-existing) is out of scope.

  • waitUntil throws after recording its XCTFail, so a timeout stops the test instead of cascading.
  • waitForControllerExit: the bound goes from 5 s to 20 s. When it's exceeded, the test records an XCTContext activity instead of failing, then SIGKILLs the helper so it never survives into the next test.
  • Two new DisplayCandidateTests cover carried hold work released by candidate arrival and by invalidation.

Tests: DisplayCandidateTests|NavigationMultiFileV2Tests ran 16 tests with 0 failures. 8 were skipped because the real-helper binaries weren't set locally.
This PR only changes tests. Reviewed by the Commander (diff read).

🤖 Generated with Claude Code

Non-blocking follow-ups from the #808 review: waitUntil now throws after
recording its XCTFail so a timeout stops the test instead of cascading;
the post-detach helper-exit bound is 20s (was 5s) and logs via
XCTContext instead of failing when a slow runner exceeds it, force-
killing the helper so it's never left running; DisplayCandidateTests
gains model-level cases for carried hold work released by a v2 frame
arriving and by invalidation (only the timeout path was covered).

Implementation-Agent: Claude Sonnet 5 (daniel-parent subagent)
Commit-Executor: daniel-parent subagent (Claude Sonnet 5)
Co-authored-by: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@d-q222
d-q222 merged commit a852363 into main Sep 17, 2026
21 checks passed
ItsAkilesh pushed a commit to ItsAkilesh/flashtex that referenced this pull request Sep 18, 2026
…ash-tex#800)

`testLateSaveReceiptIsReconciledWithoutLosingLaterEdits` waited three fixed
1.6 s sleeps for a receipt the fake helper delays by 1.2 s. On a loaded runner
that margin is not the real problem: the fake's own write fires the live
`DocumentWatcher`, whose status check goes back to the same fake and so answers
late too — appending a `status` entry to `lateReplies` and overwriting
`captureNote` with "Could not check paper.tex on disk: no status reply from the
project-files helper within 0.4 s", which is exactly how main CI failed at
:437/:450. Which of the two timers wins (the watcher's single retry after
max(helperTimeout, 0.5) s versus the fake's 1.2 s delay) is decided by load, so
widening the sleep makes it worse: a wider window lets the extra round trip
complete and breaks the test's own reply-count invariant.

- Wait on the observable condition instead: the late receipt is reconciled when
  the text it confirms has become the baseline (`savedText`), and, in case 3,
  when the late conflict is surfaced. `waitUntil` follows the shape flash-tex#812 added
  in NavigationMultiFileV2Tests — generous bound, XCTFail plus throw, with the
  late-reply list in the message.
- Stop the watcher for this test, which is about the save path only; its own
  timing is covered by DocumentWatcherTests, and no save here succeeds, so
  nothing re-arms it. The reply-count invariant is kept and tightened: exactly
  one late reply per save, now asserted in case 3 as well.

No product change: the status check the watcher made was correct (it reported
`unchanged`); it only clobbered a transient note and a test-visible counter.

Evidence: 12/12 sequential runs of the single test pass, 3.70-4.96 s (was a
fixed 6.1 s); full DocumentFilesTests 13 tests, 4 skipped (no Rust helper
locally), 0 failures. With the delay shortened to 0.6 s, which forces the
watcher's retry to land after the reply, the old test failed deterministically
with the CI message and lateReplies == 2; the new one passes.

Implementation-Agent: Claude Opus 5 (daniel-parent subagent)
Commit-Executor: daniel-parent (Claude Opus 5)
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
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.

mac tests: harden the helper wait helpers after #808 (waitUntil should throw; 5 s helper-exit bound can flake)

1 participant