Skip to content

Make abort E2E snapshots tolerate timing variants#1808

Merged
stephentoub merged 1 commit into
mainfrom
stephentoub-csharp-abort-flake
Jun 26, 2026
Merged

Make abort E2E snapshots tolerate timing variants#1808
stephentoub merged 1 commit into
mainfrom
stephentoub-csharp-abort-flake

Conversation

@stephentoub

Copy link
Copy Markdown
Collaborator

Abort E2E tests can produce different valid request histories depending on when AbortAsync lands. Runtime PR investigations saw C# replay mismatches where an in-flight tool result was interrupted instead of recorded as a missing tool, and where streaming abort retained the original user prompt while dropping the aborted assistant response.

This updates the affected replay snapshots with those legal alternatives. No production code changes are included: the tests still cover the public contract that abort completes and the session remains usable, while the cassettes stop requiring a single timing-dependent history.

Validation:

  • GITHUB_ACTIONS=true dotnet test dotnet\test\GitHub.Copilot.SDK.Test.csproj --filter "FullyQualifiedName=GitHub.Copilot.Test.E2E.SessionE2ETests.Should_Abort_A_Session|FullyQualifiedName~GitHub.Copilot.Test.E2E.AbortE2ETests"
  • Synthetic replay requests for the two reported CI histories matched the updated snapshots
  • git diff --check

Add cassette alternatives for valid abort histories where an in-flight tool result is interrupted and where streaming abort retains only the original user prompt before recovery.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 26, 2026 16:16
@stephentoub stephentoub requested a review from a team as a code owner June 26, 2026 16:16

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.

Pull request overview

Updates the replay-proxy YAML cassettes used by the .NET E2E abort tests to accept multiple valid request histories that differ based on when AbortAsync takes effect. This keeps the tests focused on the public contract (abort completes and the session remains usable) while removing timing-dependent brittleness in the recorded histories.

Changes:

  • Add an alternative should_abort_a_session conversation where both tool calls are recorded as interrupted (instead of “missing tool” + interrupted).
  • Add an alternative should_abort_during_active_streaming conversation where the original long user prompt is retained but the aborted assistant response is dropped before the recovery prompt.
Show a summary per file
File Description
test/snapshots/session/should_abort_a_session.yaml Adds an additional valid abort-timing variant where both tool calls are interrupted.
test/snapshots/abort/should_abort_during_active_streaming.yaml Adds a streaming-abort variant where the initial user prompt remains in history but the aborted assistant message is absent.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Low

@stephentoub stephentoub merged commit 1f3e1d7 into main Jun 26, 2026
32 checks passed
@stephentoub stephentoub deleted the stephentoub-csharp-abort-flake branch June 26, 2026 16:49
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.

2 participants