Files
reverse-engineering-anything/tests/support
Cassie_FoxandClaude Opus 5.5 5919dc983a test(mcp): cancel analyze_javascript_application through an MCP client (#16476)
* test(mcp): cancel analyze_javascript_application through an MCP client

Refs #1065. The existing JavaScript cancellation tests either call the
analysis function directly or cancel through a mocked progress reporter
in the process-global project. These six mcp-boundary tests cancel
through the production server, the real 100 ms progress throttle and a
real worker, and pin the delivered cancelled result, the absent reply
frame, the removed worker folders and the next call. The last test pins
the late race: a cancel that arrives while the success reply is being
written still lets that reply out, keeps the Evidence and logs ok.

The terminal-progress cancel is left to the process-global test, which
already covers it. The observer helper lives in tests/support so the
reply and progress holds are not copied between files.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(mcp): assert no reply only after the cancelled call settles

The three no-reply checks followed a client ping, which only raced the
server's handler tail on microtask order. With REA's transport changed to
keep notifications/cancelled from the SDK, so the SDK really writes the
cancelled result, the old tests still passed 6 of 6.

observeToolCall now offers settled(): it waits until REA's handler for the
call returned, lets the SDK make its reply decision, and joins any reply the
SDK handed to REA's transport. The same late-reply change now fails all five
cancellation tests at their no-reply check, also with a 50 ms delay in the
handler or in REA's publish path.

Raised by Greptile on #16476.

🤖 Generated with Claude Code (Opus 5.5) 🦊

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-03 17:49:02 -05:00
..