Stabilize session lifecycle E2E tests - #2687
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted lifecycle sequencing changes are consistent with session semantics and introduce no unresolved issues.
Review tier: Balanced
Findings: None
What changed in this PR
Stabilizes session lifecycle E2E tests by avoiding overlapping session ownership and active-turn cancellation races.
Changes:
- Node disconnect test now runs from
session.idle. - Python resume test disconnects the original session first.
| File | Description |
|---|---|
nodejs/test/e2e/session.e2e.test.ts |
Tests handler-triggered disconnect after turn completion. |
python/e2e/test_mcp_and_agents_e2e.py |
Detaches before resuming with custom-agent configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
stephentoub
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session.idle, after the active turn has completed, so it tests disconnecting inside event dispatch without also racing active-turn cancellationRoot causes
The Windows Node failure was not an event-handler dispatch deadlock. The test detached on
user.messagewhile the turn was still active, sosession.detachcould wait on active-turn shutdown; when it remained pending, test teardown disposed the JSON-RPC connection and produced-32097.The macOS Python failure resumed the same session while its original attachment was still live. Applying custom-agent configuration during that overlapping ownership transition could leave
session.resumepending. The replay proxy'sNo stored conversationsmessages were interleaved output from another xdist worker, not a missing fixture for the timed-out request; timeout diagnostics showed the blocked RPC wassession.resume.Validation
session.e2e.test.ts: 37 passed, 2 skippedtest_mcp_and_agents_e2e.py: 11/11 passes for default transport and 11/11 for in-processty check copilotpassedThis is based directly on current
mainand is independent of #2544.