You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TestRunServer_ContextCancelled races closed stdin against the cancelled context #8355
TestRunServer_ContextCancelled (pkg/svc/mcp/server_additional_test.go) failed in 🧪 Test on #8354 at 2026-11-13 02:29Z (job 131631151600) with An error is expected but got nil. That PR changes only CI workflow steps and a workflow contract test, so the failure is not caused by it.
The test cancels the context and then calls RunServer, which serves over the process's standard input. When standard input is already at end of file, as it is in CI, the server can return nil from the closed input before it observes the cancelled context. Which one wins is a race, so the test passes or fails by timing.
Problem
A correct pull request goes red on an unrelated test, and scheduled agent runs cannot rerun a failed job (devantler-tech/monorepo#4428), so each occurrence costs a new commit and a full ~70-minute CI cycle.
Hypothesis and success signal
If the test controls the transport (for example an in-memory transport, or a stdin it owns that never reaches end of file) so the only way to stop is the cancelled context, it becomes deterministic. Success: go test -run TestRunServer_ContextCancelled -count=500 ./pkg/svc/mcp/ passes with standard input at end of file, and the test still fails if RunServer ignores a cancelled context.
Acceptance criteria
The test no longer depends on the state of the process's standard input.
A negative control shows it still catches a RunServer that ignores cancellation.
Activity
chore: agent-claim #8355 nonce=932032db78cb70f79f43526fccd380ba