Skip to content

MCP: cancel the e2e export at its first progress notification - #668

Closed
mrpdaemon wants to merge 1 commit into
storytold:mainfrom
mrpdaemon:claude/fix-mcp-export-cancel-race
Closed

mrpdaemon wants to merge 1 commit into
storytold:mainfrom
mrpdaemon:claude/fix-mcp-export-cancel-race

Conversation

@mrpdaemon

Copy link
Copy Markdown
Contributor

Problem

crates/mcp/tests/e2e.rs::export_progress_and_cancel failed every run on a 32-core Linux machine (also on unchanged main):

assertion `left == right` failed: cancelled request must not reply: {"id":4, … all 8 files …}

The test waited for a progress notification with progress > 0 before sending notifications/cancelled. With many cores the batch renders four photos side by side (export_parallelism), and progress notifications are throttled to one per 100 ms, so the first notification past 0 was often the final 8-of-8 one, sent just before the reply. The cancel always arrived too late.

Fix

Test only: cancel at the first notification (progress == 0). Progress is reported before each photo is placed, so photo 0 is still written and the test's "only completed photos remain, at least one" assertions hold, while the rest of the batch is now margin for the cancel to arrive.

Testing

  • 20/20 passes of cargo test -p lightcraft-mcp --test e2e export_progress_and_cancel (previously 0/3).
  • cargo xtask ci green.

🤖 Generated with Claude Code

export_progress_and_cancel waited for progress > 0 before cancelling. On
many cores the batch renders four photos at a time and notifications are
throttled to 100 ms, so the first one past 0 was often the final 8-of-8,
sent just before the reply: the cancel always came too late. Progress is
reported before each photo is written, so cancelling at 0 still leaves
at least one complete photo, with the rest of the batch as margin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HarrisXiu added a commit to HarrisXiu/lightcraft that referenced this pull request Oct 11, 2026
… that outlasts one burst"

This reverts commit fb9a179.

The larger batch only gives the cancellation more time; it stays dependent on
timing (issue storytold#674). A deterministic fix that holds the export at a photo
boundary is coming as its own PR, and storytold#668 touches the same lines. This branch
keeps only the Synchronize Folder path fix so it conflicts with neither.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Member

Thanks, @mrpdaemon! The #674 flake was fixed by #935, which landed in #975. It holds the export after the first photo until the cancel arrives, so the test no longer depends on machine speed. Closing this one; your #667 is in the next batch. If you haven't already, come and join us on Discord: https://discord.gg/artcraft


Generated by Claude Code

emmertex added a commit to Kaan88/lightcraft that referenced this pull request Oct 29, 2026
lensdb: built-in-lens compacts match again (spec-only DNGs, Optics status)
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