Skip to content

Harden cross-suite E2E process cleanup - #2539

Merged
stephentoub merged 4 commits into
mainfrom
stephentoub-harden-merge-queue-tests
Sep 4, 2026
Merged

stephentoub merged 4 commits into
mainfrom
stephentoub-harden-merge-queue-tests

Conversation

@stephentoub

@stephentoub stephentoub commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • fix shared proxy shutdown at the source by rejecting late connections and force-closing active HTTP/TLS connections before awaiting server close
  • centralize bounded Node test-child shutdown with graceful SIGTERM, SIGKILL escalation, and race-safe timer/listener cleanup
  • bound Python and Go replay-proxy shutdown, including Windows process-tree termination and visible cleanup failures
  • replace nested PowerShell startup in .NET and Rust Windows zero-timeout shell E2Es with cmd-native delays; strengthen Rust coverage by proving the process remains killable

These are test harness reliability fixes only; SDK runtime behavior is unchanged. Release-artifact checksum retry behavior is untouched.

Validation

  • shared harness: full suite (69 passed), including active-response shutdown regression coverage
  • Node: typecheck, focused Prettier/ESLint, build, and affected E2Es (9 passed)
  • Python: focused Ruff/ty checks and OAuth E2Es (4 passed)
  • Go: test harness package/vet and OAuth E2E; one unrelated direct-RPC OAuth status retry passed when isolated
  • Rust: nightly formatting, check/Clippy, and targeted Windows zero-timeout E2E
  • .NET: targeted Windows zero-timeout E2E

The final design and repository-wide occurrence audit were independently reviewed with Claude Opus 5.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@stephentoub
stephentoub requested a review from a team as a code owner September 4, 2026 18:29
Copilot AI balanced review requested due to automatic review settings September 4, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The teardown changes are scoped, race-safe, and preserve the intended E2E assertions.

Review tier: Balanced
Findings: None

What changed in this PR

Hardens cross-platform E2E teardown without changing SDK runtime behavior.

Changes:

  • Adds bounded graceful shutdown with SIGKILL escalation for the Node OAuth MCP helper.
  • Replaces nested PowerShell startup with a cmd-native Windows test command.
File Description
nodejs/​test/​e2e/​mcp_oauth.e2e.test.ts Adds race-safe, bounded child-process teardown.
dotnet/​test/​E2E/​RpcAdditionalEdgeCasesE2ETests.cs Simplifies Windows delay and marker handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0dbb9c55-3bbb-4da8-9fec-c135f7d6a3e5
@stephentoub stephentoub changed the title Harden flaky merge queue E2E teardown Harden cross-suite E2E process cleanup Sep 4, 2026
Comment thread python/e2e/testharness/proxy.py Fixed
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0dbb9c55-3bbb-4da8-9fec-c135f7d6a3e5
Comment thread python/e2e/testharness/proxy.py
Comment thread python/e2e/testharness/proxy.py
@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0dbb9c55-3bbb-4da8-9fec-c135f7d6a3e5
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

SDK Consistency Review

This PR is scoped entirely to test/E2E harness infrastructure, not public SDK client APIs. No files under nodejs/src/, python/copilot/, go/ (non-test), dotnet/src/, java/sdk/src/main/, or rust/src/ are modified.

Changes reviewed:

  • Graceful shutdown for the replaying proxy child process (SIGTERM → wait → SIGKILL/taskkill, with timeouts) added to the Go (testharness/proxy.go) and Python (testharness/proxy.py) E2E harnesses.
  • A new stopChildProcess helper with the same graceful-then-forceful shutdown pattern added to the Node.js E2E harness (sdkTestHelper.ts), replacing ad-hoc kill logic in extension_env_access.e2e.test.ts and mcp_oauth.e2e.test.ts.
  • test/harness/connectProxy.ts (shared harness used by Node E2E tests) gets idempotent/concurrent-safe stop() and rejects in-flight requests while stopping.
  • .NET and Rust E2E tests get an unrelated but related fix: adjusted zero-timeout shell test commands, and the Rust test now explicitly kills the leaked shell process via ShellKillRequest at the end of the test (good cleanup hygiene) — this exercises an existing public API rather than adding one.

Consistency assessment: Since this is test-harness-only (no public SDK API surface changed), there's no API naming/parameter/return-type parity issue to flag under the review criteria.

Minor, non-blocking observation: the "wait, then escalate to force-kill with a timeout" pattern was applied to the Go, Python, and Node.js test harnesses, but not to the Java or .NET E2E test harnesses' proxy-stop logic (only a command-string tweak landed in dotnet/test/E2E/RpcAdditionalEdgeCasesE2ETests.cs). If proxy processes have been observed to hang on stop in CI for those languages too, it may be worth applying the same graceful-shutdown pattern there in a follow-up for infra consistency — but this is test tooling, not a user-facing API, so it's a suggestion rather than a blocking issue.

No inline code comments needed; nothing here creates a cross-language SDK API inconsistency.

Generated by SDK Consistency Review Agent for #2539 · copilot · sonnet50 · 31.9 AIC · ⌖ 12.1 AIC · ⊞ 9.7K · ◷

@stephentoub
stephentoub disabled auto-merge September 4, 2026 21:15
@stephentoub
stephentoub merged commit f13e4a2 into main Sep 4, 2026
93 checks passed
@stephentoub
stephentoub deleted the stephentoub-harden-merge-queue-tests branch September 4, 2026 21:16
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.

3 participants