Fix session start subscription ordering tests - #2737
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The changes consistently remove the invalid first-event assumption while retaining the intended session ID checks.
Review effort: Balanced
Findings: None
What changed in this PR
Updates Python and .NET E2E tests to tolerate ephemeral events preceding session-start callbacks.
Changes:
- Wait specifically for session-start events.
- Preserve session ID and event-data assertions.
- Rename tests to reflect updated semantics.
| File | Description |
|---|---|
python/e2e/test_scenario_session_setup_e2e.py |
Filters for preallocated session-start events. |
python/e2e/test_scenario_cloud_e2e.py |
Filters for cloud session-start events. |
dotnet/test/E2E/ScenarioTestingSessionSetupE2ETests.cs |
Waits specifically for SessionStartEvent. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
SDK Consistency ReviewThis PR (#2737) fixes a race-condition assumption in the .NET and Python E2E tests: managed settings resolution can emit a live ephemeral event before Cross-SDK check: I compared the equivalent scenario/E2E tests in Go, Rust, Node.js, and Java:
So this is a targeted bugfix that only needed correction in the .NET and Python test harnesses — the other SDKs' tests were already written correctly and don't need changes. No cross-SDK inconsistency is introduced by this PR. ✅
|
Managed settings resolution can legitimately emit a live, ephemeral event before
session.start. The C# and Python E2E tests assumed the start event would always be the first subscription callback, causing the CAPI test failure reported in github/copilot-agent-runtime#21956.This updates the live-subscription tests to wait specifically for
SessionStartEvent/SessionStartDatawhile preserving their preallocated and server-assigned session ID assertions. Persisted event-log ordering assertions remain unchanged.Generated by Copilot