Skip to content

Stabilize Python streaming resume E2E test - #2597

Merged
roji merged 2 commits into
mainfrom
roji-fix-flaky-tests
Sep 9, 2026
Merged

roji merged 2 commits into
mainfrom
roji-fix-flaky-tests

Conversation

@roji

@roji roji commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

A cold-resume E2E run can race the original CLI's asynchronous cleanup after session.detach, causing the second CLI process to resume while the session lock is still held and eventually time out waiting for session.idle.

Wait for sessions.check_in_use on the original client to confirm the lock is released before creating the cold-resume client. This retains the existing streaming, cross-client resume, and timeout assertions rather than masking the race with a longer timeout.

Wait for the detached session lock to release before cold-resuming it from a new CLI process, avoiding a timing race in merge-queue runs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 9, 2026 20:17
@roji
roji requested a review from a team as a code owner September 9, 2026 20:17
@roji
roji enabled auto-merge September 9, 2026 20:18

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

🟡 Changes recommended

The equivalent streaming-disabled cold-resume test remains exposed to the same lock-release race.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity python/​e2e/​test_streaming_fidelity_e2e.py — This wait only protects the streaming-enabled resume path, but…
What changed in this PR

Stabilizes Python cold-resume streaming tests by waiting for session-lock cleanup before resuming.

Changes:

  • Polls sessions.check_in_use after disconnect.
  • Reuses the captured session ID during resume.
File Description
python/​e2e/​test_streaming_fidelity_e2e.py Adds session-lock release synchronization.

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

Comment thread python/e2e/test_streaming_fidelity_e2e.py Outdated
Reuse the session-lock release wait before every cold-resume path in the streaming fidelity E2E test.

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

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

SDK Consistency Review

This PR only touches python/e2e/test_streaming_fidelity_e2e.py (test-only change). It adds a helper (_wait_for_session_lock_release) that polls the existing sessions.check_in_use RPC before resuming a session in E2E tests, to avoid a race with session-lock release, plus a minor fix to capture session_id before disconnect instead of reusing session.session_id.

No SDK client/public API code is modified, and the check_in_use/CheckInUse RPC used here is already generated consistently across all six SDKs (Node.js, Python, Go, .NET, Java, Rust) — this change doesn't introduce any cross-language feature or API inconsistency. No action needed.

Generated by SDK Consistency Review Agent for #2597 · copilot · sonnet50 · 15.6 AIC · ⌖ 12.1 AIC · ⊞ 8.3K · ◷

@roji
roji added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit aa07e29 Sep 9, 2026
37 checks passed
@roji
roji deleted the roji-fix-flaky-tests branch September 9, 2026 21:02
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