Skip to content

Deflake background task removal E2E tests - #2190

Merged
stephentoub merged 4 commits into
mainfrom
stephentoub-deflake-task-removal-race
Aug 1, 2026
Merged

Deflake background task removal E2E tests#2190
stephentoub merged 4 commits into
mainfrom
stephentoub-deflake-task-removal-race

Conversation

@stephentoub

Copy link
Copy Markdown
Collaborator

Faster completion-event delivery exposed a race in the background-agent E2E test: consuming the completion notification can automatically remove the finished task before the test's explicit removal call.

This change waits for a removable terminal state and attempts explicit removal before awaiting notification completion. It permits removed: false only when completion delivery has already occurred, while always asserting that the task is absent afterward. The equivalent Python test is kept aligned with the C# behavior.

Validation

  • Targeted C# background-agent E2E test, including five consecutive repeat runs
  • Python test file syntax compilation

Generated by Copilot

stephentoub and others added 2 commits July 31, 2026 21:57
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b3ebc2e7-3ffd-4573-becd-bb1954344115
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b3ebc2e7-3ffd-4573-becd-bb1954344115
Copilot AI review requested due to automatic review settings August 1, 2026 02:37
@stephentoub
stephentoub requested a review from a team as a code owner August 1, 2026 02:37

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 background-agent E2E tests to reduce task-removal race failures.

Changes:

  • Polls for terminal task states before removal.
  • Allows automatic completion cleanup to win the removal race.
  • Verifies task absence before awaiting completion notification.
Show a summary per file
File Description
dotnet/test/E2E/RpcTasksAndHandlersE2ETests.cs Revises C# task completion/removal ordering.
python/e2e/test_rpc_tasks_and_handlers_e2e.py Aligns Python E2E behavior with C#.

Review details

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

Comment thread dotnet/test/E2E/RpcTasksAndHandlersE2ETests.cs
Comment thread python/e2e/test_rpc_tasks_and_handlers_e2e.py Outdated
@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b3ebc2e7-3ffd-4573-becd-bb1954344115
Copilot AI review requested due to automatic review settings August 1, 2026 02:43

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.

Review details

Resolved since last review (2)
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b3ebc2e7-3ffd-4573-becd-bb1954344115
Copilot AI review requested due to automatic review settings August 1, 2026 03:06

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.

Review details

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

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR modifies E2E test files only — no public SDK API surfaces are changed:

  • dotnet/test/E2E/RpcTasksAndHandlersE2ETests.cs
  • python/e2e/test_rpc_tasks_and_handlers_e2e.py

Both tests are updated in parallel to fix the same race condition (task removal racing with completion-event delivery). The logic and assertions are kept aligned across both implementations, so no consistency issues are introduced.

No action needed from other SDK owners.

Generated by SDK Consistency Review Agent for #2190 · sonnet46 16 AIC · ⌖ 5.36 AIC · ⊞ 6.6K ·

@stephentoub
stephentoub merged commit e6b06f5 into main Aug 1, 2026
42 checks passed
@stephentoub
stephentoub deleted the stephentoub-deflake-task-removal-race branch August 1, 2026 03:45
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