Skip to content

Fix the flaky export-cancel test: cancel at the second photo, not after 300 ms - #1872

Merged
emmertex merged 2 commits into
emmertex:stagingfrom
blwfish:fix/flaky-export-cancel-test
Dec 4, 2026
Merged

emmertex merged 2 commits into
emmertex:stagingfrom
blwfish:fix/flaky-export-cancel-test

Conversation

@blwfish

@blwfish blwfish commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

tests_export::a_cancelled_export_stops_within_a_second failed at random (about 1 run in 3 here, with the GPU on). It cancelled from a timer 300 ms in; when a fast machine had already finished the 12-photo batch, the cancel time was never recorded and expect("cancelled") panicked.

The progress callback now cancels when the batch asks to place the second photo: the first photo is written and the others are still in the lanes, whatever the machine's speed. The test also now pins that exactly one file is placed (it asserted only "fewer than 12").

Test-only change (crates/engine/src/tests_export.rs), no production code touched.

Verification

  • 25/25 passes with the GPU, 10/10 with CHROMAFORGE_GPU=0.
  • Mutation check: making both the consumer loop and Queue::cancelled() ignore the cancel flag exports all 12 photos and fails the test. (Ignoring only the consumer-loop check survives, because the lanes' own cancel check reaches the same stop through Queue::result.)
  • cargo xtask ci --quick on this branch after merging current staging: all stages pass (fmt, brand, quarantine, docs, notes, i18n, windows, clippy, heif, stamp, test, parity, layers, assets, deny, wasm, android).

Manual: none, no user-visible change.

🤖 Generated with Claude Code

blwfish and others added 2 commits December 3, 2026 15:59
a_cancelled_export_stops_within_a_second cancelled from a timer 300 ms in. On a
machine that finishes the 12-photo batch sooner (GPU on) the batch was already
over, the cancel time was never recorded and `expect("cancelled")` panicked, at
random (1 run in 3 here).

The progress callback now cancels when the batch asks to place the second photo:
the first is written and the others are still in the lanes whatever the speed.
The test now also pins that exactly one file is placed (it asserted only fewer
than 12).

Checks: 25/25 passes with the GPU, 10/10 with CHROMAFORGE_GPU=0. Mutation: the
consumer loop and Queue::cancelled() both ignoring the flag exports all 12 and
fails the test; ignoring only the consumer-loop check survives because the lanes'
own cancel check reaches the same stop through Queue::result.

Manual: none, no user-visible change

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@emmertex
emmertex merged commit a1d9e3e into emmertex:staging Dec 4, 2026
3 checks passed
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.

2 participants