Skip to content

dotnet: wait for terminal task status in E2E test - #2192

Closed
ellismg wants to merge 2 commits into
mainfrom
ellismg-fix-csharp-task-race
Closed

dotnet: wait for terminal task status in E2E test#2192
ellismg wants to merge 2 commits into
mainfrom
ellismg-fix-csharp-task-race

Conversation

@ellismg

@ellismg ellismg commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • wait for the C# background agent task to reach Completed, Failed, Cancelled, or Idle before continuing
  • preserve response-content, Idle cancellation, removal, and post-removal assertions

This addresses the timing race observed while exercising the SDK from copilot-agent-runtime PR #14162 (run 30674591424, job 91300567129).

Cross-SDK audit

  • C#: changed; the lifecycle test previously accepted TASK_AGENT_DONE content while status could still be Running
  • Python: safe; already waits for Completed, Failed, Cancelled, or Idle, cancels Idle, then removes
  • Node.js, Go, Java, Rust: safe from this specific race; none currently has a successful background-agent lifecycle test that waits on output and immediately removes the task

Validation

  • git diff --check
  • repository-wide audit of task lifecycle/removal E2Es in Node.js, Python, Go, Java, Rust, and C#
  • focused C# E2E invocation attempted, but this environment has .NET SDK 9.0 while the test project targets .NET 10.0; CI must execute Should_Start_Background_Agent_And_Report_Task_Details with the supported SDK

Keep polling until the background task reaches a removable terminal state instead of treating response content as completion.

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

Copilot-Session: c70e0ca7-1826-462d-bcdb-d1bb4ef859f1
@ellismg
ellismg requested a review from a team as a code owner August 1, 2026 02:54
Copilot AI review requested due to automatic review settings August 1, 2026 02:54

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 .NET E2E test to avoid racing ahead before a background agent reaches a final observable state.

Changes:

  • Waits for completed, failed, cancelled, or idle task status.
  • Preserves existing response, cancellation, removal, and post-removal assertions.
Show a summary per file
File Description
dotnet/test/E2E/RpcTasksAndHandlersE2ETests.cs Waits for a stable background-task status before continuing assertions.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR only modifies dotnet/test/E2E/RpcTasksAndHandlersE2ETests.cs — a .NET E2E test file. The change fixes a timing race by replacing response-content polling with terminal task status checks (Completed, Failed, Cancelled, Idle).

Since this is a test-only fix with no changes to the public API surface, there are no cross-SDK consistency concerns. Other SDKs' E2E tests may independently benefit from similar terminal-status polling patterns, but that is not a consistency gap introduced by this PR.

Generated by SDK Consistency Review Agent for #2192 · sonnet46 15.5 AIC · ⌖ 5.34 AIC · ⊞ 6.6K ·

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

Copilot-Session: c70e0ca7-1826-462d-bcdb-d1bb4ef859f1
Copilot AI review requested due to automatic review settings August 1, 2026 03:47

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 wasn't able to review any files in this pull request.

@ellismg ellismg closed this Aug 1, 2026
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