Skip to content

Await backend operations before acknowledging test-host hub creation/deletion - #813

Merged
wangbill (YunchuWang) merged 1 commit into
mainfrom
yunchuwang-await-test-host-hubs
Oct 9, 2026
Merged

wangbill (YunchuWang) merged 1 commit into
mainfrom
yunchuwang-await-test-host-hubs

Conversation

@YunchuWang

Copy link
Copy Markdown
Member

Summary

Make the in-process test host acknowledge task-hub creation and deletion only after the backend operation succeeds.

What changed?

  • Await the existing backend calls in CreateTaskHub and DeleteTaskHub before returning their existing empty responses.
  • Add 12 deterministic regression cases covering pending and completed operations, already-faulted and deferred failures, and both RecreateIfExists values.

Why is this change needed?

  • The handlers previously discarded the backend tasks, so RPCs returned success while operations were still pending and did not propagate asynchronous backend failures.

Issues / work items

  • Resolves: N/A
  • Related: N/A

Project checklist

  • Release notes are not required for the next release
    • Otherwise: Notes added to release_notes.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • Breaking change?
    • If yes:
      • Impact: N/A; public method signatures, protobuf contracts, and dependencies are unchanged.
      • Migration guidance: N/A.

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s): GitHub Copilot.
  • AI-assisted areas/files: The two hub lifecycle handlers in src\InProcessTestHost\Sidecar\Grpc\TaskHubGrpcServer.cs and test\InProcessTestHost.Tests\HubLifecycleTests.cs.
  • What you changed after AI output: Agent-generated changes were validated against the final committed diff; human review and attestation remain pending.

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Testing

Automated tests

  • Result: Passed locally. Hosted CI has not run and remains pending publication.
Command Result
dotnet test .\test\InProcessTestHost.Tests\InProcessTestHost.Tests.csproj --configuration Release --framework net10.0 --no-build --no-restore --filter 'FullyQualifiedName~InProcessTestHost.Tests.HubLifecycleTests' --verbosity minimal Passed: 12/12 lifecycle cases.
dotnet test .\test\InProcessTestHost.Tests\InProcessTestHost.Tests.csproj --configuration Release --framework net10.0 --no-build --no-restore --verbosity minimal Passed: 69/69 owning-suite tests.
dotnet build .\src\InProcessTestHost\InProcessTestHost.csproj --configuration Release --no-restore --verbosity quiet Passed for net6.0, net8.0, and net10.0; 0 errors. Compiler/analyzer warnings are in unchanged code.
git --no-pager diff --check origin/main...HEAD Passed.

Before the fix, the lifecycle selector produced 9 expected failures: 3 premature acknowledgements and 6 swallowed backend failures. The 3 already-completed success cases passed. The final committed change passes all 12 cases.

Full-repository validation and emulator/cloud-dependent suites were not run.

Manual validation (only if runtime/behavior changed)

  • Environment (OS, .NET version, components): Local automated validation used Windows, .NET SDK 10.0.401, and the existing in-process test-host xUnit/Moq harness.
  • Steps + observed results:
    1. No separate manual validation was performed; completion and failure paths were exercised by the automated cases above.
    2. N/A.
    3. N/A.
  • Evidence (optional): RED/GREEN logs and TRX results were retained locally.

Notes for reviewers

  • Scope is limited to the in-process test-host lifecycle RPCs. Backend create/delete semantics and the recreation argument are unchanged.
  • Waiting for completion and surfacing backend failures are intentional corrections; no cancellation API or behavior was added.
  • Hosted CI and the unchecked human-review attestations remain pending.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fcb29286-7b10-46c3-b14c-ef50314874e5
Copilot AI balanced review requested due to automatic review settings October 9, 2026 14:40

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.

🟢 Approval recommended

The focused implementation correctly addresses premature acknowledgements and is comprehensively covered by deterministic tests.

0 open findings

What changed in this PR

Ensures test-host task-hub lifecycle RPCs acknowledge requests only after backend completion and propagate failures.

Changes:

  • Await backend create/delete operations.
  • Add 12 regression cases covering completion, failures, and recreation options.
File Description
src/​InProcessTestHost/​Sidecar/​Grpc/​TaskHubGrpcServer.cs Awaits lifecycle operations before responding.
test/​InProcessTestHost.Tests/​HubLifecycleTests.cs Tests pending, completed, and failed operations.

🧠 Review effort: Balanced


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

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.

4 participants