Frun1na commented on PR #4649:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4649#issuecomment-5771819346

   
   Thanks for the review — the test now guards the fix through the real path. 
Replaced
   `TestSignalContextCancelsOnSigterm` with 
`TestExecuteSigtermTearsDownMcpSession` (b8a683f0):
   
   - **Drives `App.Execute` itself.** The test re-executes the test binary as a 
child process and runs
     `App.Execute` with the `mcp stdio` arguments against an `httptest` fake of 
the Studio MCP
     endpoint. The fake answers the initialize handshake with `mcp-session-id: 
session-1`; the parent
     waits until the proxy has forwarded the initialize response on the child's 
stdout (the transport
     has the session id from that point on), then sends SIGTERM to the child 
and asserts that
     `DELETE /api/mcp` arrives with `mcp-session-id: session-1`, exactly once, 
and the child exits
     cleanly.
   - **Mutation check.** With the production change reverted to
     `signal.NotifyContext(context.Background(), os.Interrupt)`, the child dies 
under the default
     SIGTERM disposition before any DELETE and the test fails with
     `session teardown DELETE /api/mcp was not issued after SIGTERM` — and, per 
your related note,
     the `go test ./cmd` binary itself survives and reports the failure 
normally, because the signal
     goes to the child process rather than the test runner.
   - **Subprocess isolation** is built in from the start, so the registration 
can no longer take the
     whole package's results down with it.
   - **Rebase:** done — the branch is now a single commit on `rocketmq-studio` 
tip (4c697f07);
     `go vet`, `go test ./...`, `gofmt`, and `catalog-verify` are all green 
after the rebase.
   
   I kept the coverage rather than taking the drop-the-test alternative, since 
the failure mode is
   silent by nature and the subprocess harness turned out to be straightforward.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to