Skip to content

Coordinate invocation lifetime hooks across test modules and server requests - #12633

Merged
Amaury Levé (Evangelink) merged 9 commits into
mainfrom
dev/amauryleve/multi-module-invocation-hooks
Nov 27, 2026
Merged

Amaury Levé (Evangelink) merged 9 commits into
mainfrom
dev/amauryleve/multi-module-invocation-hooks

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: c5418bd9be87c27b3074559a95ab67cd2457d8de

Dimension Assessment Rationale
Change confidence 8/10 ↑ Producer builds and packed acceptance coverage passed; aligned SDK validation passed 39 scenarios.
↑ The CI telemetry-output failure was reproduced and both affected cases pass with the test-only fix.
↓ CI on the updated head and release-branch validation remain pending.

Pull request

Summary

Relates to #11500. Add per-request invocation hooks in MTP server mode and the producer-side protocol for coordinating one hook lifetime across dotnet test modules. Review fixes cover connection readiness, cancellation, lost pipes, first-request diagnostics and mixed-version capability discovery.

Both this PR and the SDK companion dotnet/sdk#57357 are ready for review. This PR alone does not deliver SDK coordination. Merge remains gated on required reviews/checks and final aligned validation; downstream rollout and release-branch servicing remain to be decided.

The latest corrections cancel and drain active/queued server requests on EOF or reader failure before teardown, prevent queued setup after synchronous cancellation but before token callbacks, and dispose retained/unvisited handlers exactly once when participant filtering disposal fails. Shutdown retains resources until live callbacks and requests finish rather than disposing beneath them after a timed wait. An uncooperative handler requires the outer process timeout/termination policy.

Design and decision record

See RFC 024, especially sections 6–9 and 14, for protocol ownership, compatibility, alternatives, decisions and the validation matrix. The dated merge-readiness entry records the three latest review corrections and their four-case red/green evidence.

Demonstration

The change affects lifecycle coordination, not visual layout. A three-module harness exercised the actual SDK redist and packed producer with isolated package caches. Coordinated runs invoked each handler once in the owner; fallback runs invoked each once per module. A readable summary of the observed exits, callbacks and package provenance is in the RFC; the full harness and transcripts are retained locally and are not yet published.

Validation and regression proof

Final producer: 45cfda52feea4526ce9b7f0347e2d9e9f6686b65; assessed head c5418bd9be87c27b3074559a95ab67cd2457d8de adds a test-only fix after the maintained evidence document. Both Release 3.0.0-dev packages contain the producer commit in their nuspec, and packaged net10.0 DLLs match current build outputs.

Package Package SHA-256 net10.0 DLL SHA-256
Microsoft.Testing.Platform 73DF853F5E4849EC1F570DCB15814275D39C325C518CA56C44531907AFF80107 EEC5607BD1767615DD92E02C704C5CF1A61DC8989C9691C1C666830A3AC92390
Microsoft.Testing.Extensions.Retry 2E8D63EDF32ECDAA615B324952577AA339FEF5DBBB9E3E39E03B4F82108911D5 BA571D3BD37B23AF7DAD97F8DCB6227E9085ADD44650912CF5A7E741A33AF854
  • .\build.cmd -pack -c Release -bl — passed, exit 0, no warnings/errors, clean committed producer source.
  • .\.dotnet\dotnet.exe build test\UnitTests\Microsoft.Testing.Platform.UnitTests\Microsoft.Testing.Platform.UnitTests.csproj -c Release --no-restore -v:q '-bl:artifacts\log\invocation-review-all-targets-final.binlog' — passed, exit 0, no warnings/errors.
  • For each TFM in net10.0, net11.0, net462: .\.dotnet\dotnet.exe run --project test\UnitTests\Microsoft.Testing.Platform.UnitTests\Microsoft.Testing.Platform.UnitTests.csproj -c Release -f <TFM> --no-build -- --filter 'FullyQualifiedName~DotnetTestConnectionTests|FullyQualifiedName~InvocationLifetimeRunnerTests|FullyQualifiedName~ServerTestHostTests|FullyQualifiedName~ProtocolTests|FullyQualifiedName~TestHostBuilderTests' --report-trx --results-directory artifacts\TestResults\invocation-review-final-<TFM> — each passed, exit 0; 226 passed, 0 failed, 0 skipped; 678 total. Existing method-level scheduling was retained, including environment-resource exclusion/restoration and original worker-task joins.
  • Independent discovery: .\.dotnet\dotnet.exe test --project test\IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests.csproj -c Release --no-build --list-tests text --filter 'FullyQualifiedName~InvocationLifetimeHandlerTests' -p:UsingDotNetTest=true -p:TestingPlatformCommandLineArguments= -p:TestRunnerAdditionalArguments= '-bl:artifacts\log\invocation-final-acceptance-discovery.binlog' — passed, exit 0; 29 discovered. This pinned CLI requires explicit text before the next option; the corrected invocation supersedes an argument-parsing failure, not a test failure.
  • With $results = Join-Path (Get-Location).Path 'artifacts\TestResults\invocation-final-acceptance': .\.dotnet\dotnet.exe test --project test\IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests.csproj -c Release --no-build --filter 'FullyQualifiedName~InvocationLifetimeHandlerTests' -p:UsingDotNetTest=true "-p:ArtifactsTestResultsDir=$results" '-bl:artifacts\log\invocation-final-acceptance.binlog' --output Detailed — passed, exit 0; 29 passed, 0 failed, 0 skipped. The fresh outer net12.0 TRX passed the acceptance execution verifier against the independently discovered/source-reconciled 29-case plan. Generated consumers use the fixture's fresh isolated package cache and cover net11.0, net10.0, and net462.
  • CI test repair: with DOTNET_CLI_CONTEXT_VERBOSE=1, .\.dotnet\dotnet.exe test --project test\IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests\Microsoft.Testing.Platform.Acceptance.IntegrationTests.csproj -c Release --no-build --filter 'FullyQualifiedName~PackagedPlatform_ExposesCoordinationCapabilityAndRespectsOverride' -p:UsingDotNetTest=true "-p:ArtifactsTestResultsDir=$results" '-bl:artifacts\log\invocation-telemetry-after.binlog' --output Detailed — passed at c5418bd9be87c27b3074559a95ab67cd2457d8de's test source, exit 0, 2 passed, 0 skipped; $results was artifacts\TestResults\invocation-telemetry-after resolved to an absolute path. At 61e7cdb4ab97a4bd64fa749c2174325b6b40a9c1, the same selection exited 2 with both rows failing because the property was preceded by Telemetry is: Disabled. The new assertion checks the final property line exactly and explicitly enables verbose diagnostics for the child process. Release pack and focused acceptance-project build both passed before the green run. TRX and binlogs are retained locally.

Earlier evidence, not final-package revalidation: the previous producer package 526136595D43D71726B7B810919C37DDE1765EBB03CB89727BB2FF40A9973C44 composed with dotnet/sdk 2b26a947128aa570fa2b284d68c158b6b8232173 passed 333 focused SDK tests and 33 composed scenarios. The isolated harness invoked dotnet test --solution E2E.slnx with serial execution, retries, setup/test/cleanup failure, timeout, discovery, --no-build, --no-dependencies, zero-result, minimum-count and ignore-exit variations. Zero/minimum cases returned 8/9 to parent and cleanup; ignored setup/cleanup failures returned 1. Build-enabled dotnet test --solution E2E-mixed.slnx used a genuine Phase 1 sibling and two new modules, verified warning-before-startup and loaded DLL hashes. Earlier python .github\scripts\test_check_localization.py and python .github\scripts\check_localization.py passed (41 guard tests, 364 catalogs). These historical commands/results remain recorded in RFC section 14.

Aligned SDK evidence: the producer packages listed above and dotnet/sdk 11f01d97b99149c1e504ed137b5c611a59b666ab passed 39 composed scenarios in an independently repeated clean-cache run, including real control-pipe loss and owner termination. See dotnet/sdk#57357 for commands, hashes and outcomes. The new TestFx head changes only an acceptance assertion, not the producer.

Remaining gates: CI on the updated TestFx head is pending. OS Ctrl+C, live-owner policy-exception, custom target/output replacement and release-branch/dependency-flow validation are not proven. The earlier server-concurrency rendezvous does not conclusively establish competing gate arrival, and the accepted-owner data-pipe counterfactual remains unexecuted. No pending CI run is claimed as passed.

Test-value evidence

Latest review corrections: retain the new tests against unfixed merge 5cbfc775b028ca5b2952599fdcf53c3411ebc7e6; rebuild Release net10.0 and run .\.dotnet\dotnet.exe run --project test\UnitTests\Microsoft.Testing.Platform.UnitTests\Microsoft.Testing.Platform.UnitTests.csproj -c Release -f net10.0 --no-build -- --filter 'FullyQualifiedName~EndOfStreamCancelsAndDrainsInvocation|FullyQualifiedName~QueuedCancellationSkipsHandlerSetup|FullyQualifiedName~BuilderFilteringFailure' --report-trx --results-directory artifacts\TestResults\invocation-review-<red-or-green>. Red: exit 2, 4 executed/failed, no skips, at premature server completion, missing cancellation exception, and missing handler-disposal assertions. Green: exit 0, the same 4 passed. Final producer passes the full focused selection on all three targets. Cases: RunAsync_EndOfStreamCancelsAndDrainsInvocationBeforeDisposingServices, ExecuteRequestAsync_QueuedCancellationSkipsHandlerSetupBeforeTokenCallbacksRun, and both rows of BuilderFilteringFailure_DisposesEveryHandlerOnceAndPreservesOriginalException. Binlogs/TRX are retained under the named local artifact directories; see the maintained RFC for exact source states and commands.

Earlier feature sensitivity: independently packed behavior removals caused CoordinatedModule_SkipsTheHandlersAlreadyRunByTheOwnerAndKeepsTheirOutputs to fail when participant suppression was disabled, and DotnetTestOwner_AdvertisesItsHandlersAndRunsThemLocallyWhenCoordinationIsNotAccepted to fail when property 23 was omitted. Restoring/repacking passed the then-current class (27/27). These are compiling behavior-removal checks, not pristine-baseline runs. AcceptedOwner_ControlChannelFailureAndThrowingStopCallbackCancelApplication failed before its callback-failure fix and passed afterward. The SDK's zero/minimum cleanup verdicts and three ignored-infrastructure-failure cases also showed the documented red/green sensitivity. Earlier evidence does not replace the pending final composed checks.

…t test modules

Implements the remaining work for #11500 on top of #12602:
- Run invocation lifetime handlers once around each server-mode run request.
- Phase 2 (protocol 1.5.0): the SDK-selected owner advertises its handler UIDs
  (handshake property 23), runs setup/cleanup once for the whole dotnet test
  invocation after the SDK acknowledges (property 24), shares setup outputs with
  sibling modules, and receives RunInvocationCleanup with the aggregate result.
- Fall back to per-module handlers when coordination is not accepted.
- Update RFC 024 with the implemented contract and validation record.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 16:23

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.

🟡 Changes recommended

Connection loss can trigger teardown while setup hooks are still running, leaving cleanup unawaited and requests using a disposed gate, while disposal failures can also leak initialized handlers.

2 open issues
What changed in this PR

Extends Microsoft.Testing.Platform’s invocation hooks toward #11500 with per-request server lifetimes and producer-side support for coordinating hooks across test modules. Cross-module coordination still depends on the separately maintained, unpublished SDK change.

Changes:

  • Adds fresh handlers for server run requests, request serialization, and environment restoration.
  • Introduces protocol 1.5.0 coordination messages, owner negotiation, participant suppression, and cooperative connection-loss handling.
  • Updates capability metadata, diagnostics, documentation, and unit and packed-consumer tests.

Test-value evidence: Static review only. For assessed revision 3f9ddbff290851448d1316843c6b875d449b64b2, the PR reports 206 focused unit-test passes and 29 packed-consumer passes against producer 0307148936848c7b3831adc0c4d4f1e311530881; execution artifacts were not independently verified here. Final aligned SDK/producer validation remains pending.

Confidence at a glance

🟡 MTP lifecycle and protocol

Source paths and ownership transitions were checked. Runtime behavior and final SDK interoperability were not independently exercised.

File Description
test/​UnitTests/​Microsoft.Testing.Platform.UnitTests/​ServerMode/​DotnetTestConnectionTests.cs Tests negotiation, cancellation, and pipe loss.
test/​UnitTests/​Microsoft.Testing.Platform.UnitTests/​IPC/​ProtocolTests.cs Pins lifecycle messages and wire layouts.
test/​UnitTests/​Microsoft.Testing.Platform.UnitTests/​Hosts/​ServerTestHostTests.cs Tests request-scoped hooks and recovery.
test/​UnitTests/​Microsoft.Testing.Platform.UnitTests/​Extensions/​InvocationLifetime/​InvocationLifetimeRunnerTests.cs Tests coordinated setup and cleanup.
test/​UnitTests/​Microsoft.Testing.Platform.UnitTests/​Extensions/​InvocationLifetime/​InvocationLifetimeJsonTests.cs Tests handler-UID JSON encoding and parsing.
test/​UnitTests/​Microsoft.Testing.Platform.DotnetTestProtocolContract.UnitTests/​DotnetTestProtocolContractTests.cs Updates independent protocol contract expectations.
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​InvocationLifetimeHandlerTests.cs Adds packaged server, capability, and participant cases.
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​DotnetTestPipe/​DotnetTestPipeProtocol.cs Adds coordination handshake identifiers.
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​DotnetTestPipe/​DotnetTestPipeCoverageSummaryTests.cs Updates advertised-version expectations.
test/​IntegrationTests/​Microsoft.Testing.Platform.Acceptance.IntegrationTests/​DotnetTestPipe/​DotnetTestPipeBaselineTests.cs Includes protocol 1.5.0 in baseline expectations.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​IInvocationLifetimeCoordinationChannel.cs Defines the internal coordination channel.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​IPC/​Serializers/​ServerControlMessageSerializer.cs Serializes aggregate cleanup results.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​IPC/​Serializers/​InvocationLifetimeSerializers.cs Adds lifecycle message serializers.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​IPC/​ObjectFieldIds.cs Allocates lifecycle wire identifiers.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​IPC/​Models/​ServerControlMessage.cs Adds optional aggregate-result fields.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​IPC/​Models/​InvocationLifetimeMessages.cs Defines lifecycle messages and protected output formatting.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​IPC/​Constants.cs Declares coordination capabilities and protocol version.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​DotnetTestConnection.ServerControl.cs Coordinates readiness, cancellation, and cleanup requests.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​DotnetTestConnection.InvocationLifetime.cs Sends lifecycle messages and checks acceptance.
src/​MTP/​Microsoft.Testing.Platform/​ServerMode/​DotnetTest/​DotnetTestConnection.cs Integrates owner negotiation into handshaking.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.zh-Hant.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.zh-Hans.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.tr.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.ru.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.pt-BR.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.pl.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.ko.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.ja.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.it.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.fr.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.es.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.de.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​xlf/​PlatformResources.cs.xlf Adds lifecycle diagnostic catalog entries.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​PlatformResources.resx Defines coordination and request-failure diagnostics.
src/​MTP/​Microsoft.Testing.Platform/​Resources/​PlatformResources.cs Exposes request diagnostics to unit tests.
src/​MTP/​Microsoft.Testing.Platform/​IPC/​Serializers/​RegisterSerializers.cs Registers the lifecycle serializers.
src/​MTP/​Microsoft.Testing.Platform/​IPC/​NamedPipeClient.cs Allows cooperative owner connection-loss handling.
src/​MTP/​Microsoft.Testing.Platform/​InternalAPI/​InternalAPI.Unshipped.txt Records new internal coordination APIs.
src/​MTP/​Microsoft.Testing.Platform/​Hosts/​TestHostOchestratorHost.cs Enables coordination for orchestrator owners.
src/​MTP/​Microsoft.Testing.Platform/​Hosts/​TestHostBuilder.Modes.cs Filters coordinated handlers and configures ownership.
src/​MTP/​Microsoft.Testing.Platform/​Hosts/​TestHostBuilder.cs Carries coordination state during host construction.
src/​MTP/​Microsoft.Testing.Platform/​Hosts/​ServerTestHost.RequestExecution.cs Wraps server requests with gated hook lifetimes.
src/​MTP/​Microsoft.Testing.Platform/​Hosts/​ServerTestHost.cs Adds the handler manager and request gate.
src/​MTP/​Microsoft.Testing.Platform/​Hosts/​CommonTestHost.cs Advertises owner handlers and enables coordination.
src/​MTP/​Microsoft.Testing.Platform/​Helpers/​EnvironmentVariableConstants.cs Defines owner and participant environment markers.
src/​MTP/​Microsoft.Testing.Platform/​Extensions/​InvocationLifetime/​InvocationLifetimeRunner.cs Coordinates outputs, completion, and aggregate cleanup.
src/​MTP/​Microsoft.Testing.Platform/​Extensions/​InvocationLifetime/​InvocationLifetimeJson.cs Implements handler-UID JSON support.
src/​MTP/​Microsoft.Testing.Platform/​Extensions/​InvocationLifetime/​InvocationCompletedContext.cs Documents server request exit-code semantics.
src/​MTP/​Microsoft.Testing.Platform/​Extensions/​InvocationLifetime/​IInvocationLifetimeHandler.cs Documents per-request server hooks and exclusions.
src/​MTP/​Microsoft.Testing.Platform/​buildMultiTargeting/​Microsoft.Testing.Platform.props Publishes an overridable coordination capability.
docs/​RFCs/​024-Invocation-Lifecycle-Hooks.md Updates contracts, decisions, and validation status.

Review effort: Balanced

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 25, 2026
@github-actions github-actions Bot removed the state/needs-review Awaiting review from the team. label Nov 25, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 16:55

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.

🔵 Needs a closer look

A cancellation race can trigger setup for already-canceled requests, and a handler-disposal exception can leave other initialized handlers undisposed.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Recheck cancellation after acquiring the setup gate

src/​MTP/​Microsoft.Testing.Platform/​Hosts/​ServerTestHost.RequestExecution.cs:92

A queued request can start handler construction and setup after its cancellation has already been recorded. TryRequestCancellation() records cancellation before Task.Run cancels the token, so releasing the gate in that interval lets this token-only check pass. Also call rpcInvocationState.ThrowIfCancellationRequested() after acquiring the gate to prevent setup side effects for an already-canceled request.

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 17:29

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.

🔵 Needs a closer look

Queued cancellation can still allow handler setup, and a disposal exception during filtering can leave other initialized handlers undisposed.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Recheck invocation cancellation after acquiring the gate

src/​MTP/​Microsoft.Testing.Platform/​Hosts/​ServerTestHost.RequestExecution.cs:92

A request canceled while waiting for the invocation gate can still construct handlers and run setup if the gate opens before the scheduled token-cancellation task runs. RpcInvocationState already records cancellation synchronously, but this check only examines the token. Recheck rpcInvocationState.ThrowIfCancellationRequested() immediately after acquiring the gate, and add a queued-cancellation regression test.

Review effort: Balanced

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 09:05
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed needs/merge-conflict-resolution PR has merge conflicts that must be resolved. labels Nov 27, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 27, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 27, 2026

@github-actions github-actions Bot 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.

🧪 Test quality review — PR #12633

Compared merge base ea3238ea465ae2e1e72a04a023ffdf127bcd9a00 with head 45cfda52feea4526ce9b7f0347e2d9e9f6686b65. Evidence applies to this head, not every intermediate commit.

Limited-depth static review. The workflow did not run builds or tests, and I did not grade every changed test method individually. I sampled the new ServerTestHostTests methods and read the PR's reported evidence.

Test-value evidence

Contract Evidence kind Notes
Per-request server handlers: fresh handlers per run request, environment restore, gate serialization Static prediction, plus author-reported execution (unverified) Tests include RunAsync_RunRequestsUseFreshInvocationHandlersAndRestoreEnvironmentBeforeDiscovery and RunAsync_RunAndDiscoveryWaitForAnActiveInvocation, which assert ordered event sequences. Removing the gate or the fresh-handler creation would likely change those sequences.
Cancellation and drain on EndOfStream and queued cancellation Static prediction RunAsync_EndOfStreamCancelsAndDrainsInvocationBeforeDisposingServices and ExecuteRequestAsync_QueuedCancellationSkipsHandlerSetupBeforeTokenCallbacksRun target the previously reported review issues.
Protocol 1.5.0 coordination messages, serializers, participant suppression Author-reported execution only (unverified) The PR body reports packed-consumer mutations that failed as intended and 206 focused unit passes. I did not independently verify the execution records.
Accepted-owner data-pipe regression Unverified The PR body states its counterfactual has not been executed.
Docs, resources, xlf Not applicable Not behavior-bearing.

🧵 Parallel safety

STATUS: CLEAN, for the files inspected. Coverage is partial: DotnetTestProtocolContract.UnitTests and the other changed test files were not inspected.

Test assembly Scope Notes
Microsoft.Testing.Platform.Acceptance.IntegrationTests MethodLevel Each new test uses its own GUID-named log file and passes environment variables only to the child process.
Microsoft.Testing.Platform.UnitTests MethodLevel The new tests use a per-test mocked IEnvironment. Pipe names come from instance pipe servers or a GUID.

No parallel-safety findings.

Per-test assessment

Pseudo-mutation evidence below consists of static predictions, not executed mutation results.

Result Quality Test Notes Follow-up
Pass B (80–89) new ServerTestHostTests.RunAsync_RunAndDiscoveryWaitForAnActiveInvocation The ordered event assertions are strong, but the rendezvous is log-line based. Investigation requested in an inline comment: wait on a signal that proves the requests are blocked on the gate.
Not graded — The other changed tests, 10 files in total Not individually graded in this run (reduced depth). Re-run /review-tests for a full scorecard.

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto (Claude Sonnet 5.5) · ~61 AIC · ⌖ ~2 AIC · ⊞ 8.5K

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Nov 27, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. labels Nov 27, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 27, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 27, 2026

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.

🔵 Needs a closer look

Cross-repository SDK and lifecycle coordination requires maintainer review of dependency rollout and final aligned package validation, with control-pipe-loss and owner-exit checks still pending while siblings run.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 27, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 27, 2026
@github-actions

This comment has been minimized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 11:22
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/approved Proposal approved; ready for implementation. labels Nov 27, 2026

@github-actions github-actions Bot 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.

🧪 Test quality review — PR #12633

Compared merge base ea3238ea465ae2e1e72a04a023ffdf127bcd9a00 with head c5418bd9be87c27b3074559a95ab67cd2457d8de. Evidence applies to this head, not every intermediate commit.

Test-value evidence

This workflow is static and read-only. Nothing was executed, so there are no executed results here. The PR description reports red/green runs, but I did not verify those records against the exact revisions.

Contract Test / decisive assertion Evidence
Request cancellation on EOF drains the invocation before services are disposed ServerTestHostTests.RunAsync_EndOfStreamCancelsAndDrainsInvocationBeforeDisposingServices Static prediction: likely detects a premature teardown. The PR reports 4 red then 4 green for this group (unverified).
A cancellation queued before token callbacks skips handler setup ExecuteRequestAsync_QueuedCancellationSkipsHandlerSetupBeforeTokenCallbacksRun asserts OperationCanceledException, 0 handlers built, 0 framework builds and the restored environment Static prediction: likely detects setup running after cancellation. Reported red/green is unverified.
Builder filtering failure disposes every handler once and keeps the original exception TestHostBuilderTests (changed lines 348-411) Static prediction only.
Wire protocol and capability additions ProtocolTests, DotnetTestConnectionTests, InvocationLifetimeJsonTests, DotnetTestProtocolContractTests, and packed acceptance tests in InvocationLifetimeHandlerTests Not individually traced. These groups are unassessed because of the review budget. The PR reports 226 unit and 29 acceptance cases passing, which I could not match to this head.

Not proven: OS Ctrl+C, the accepted-owner data-pipe counterfactual, and CI on this head. The PR description states these remain open.

🧵 Parallel safety

STATUS: CLEAN (coverage limited).

Test assembly Scope Workers
Microsoft.Testing.Platform.UnitTests MethodLevel all cores
Microsoft.Testing.Platform.Acceptance.IntegrationTests not inspected beyond the changed regions not inspected
Microsoft.Testing.Platform.DotnetTestProtocolContract.UnitTests not inspected not inspected

The specialist found 0 findings. Environment-variable mutations in TestHostBuilderTests use [ResourceLock(WellKnownResources.EnvironmentVariables)] with try/finally restore, and the new ServerTestHostTests use a mocked IEnvironment. The specialist read only the diff, so this is not a full assembly audit.

Per-test assessment

Per-test grading was not completed for the roughly 30+ new and modified methods in this large diff. That is a coverage limit, not an all-clear. Only the two tests reviewed in depth are listed. Pseudo-mutation evidence is a static prediction, not an executed result.

Result Quality Test Notes Follow-up
Pass B (80–89) new ServerTestHostTests.ExecuteRequestAsync_QueuedCancellationSkipsHandlerSetupBeforeTokenCallbacksRun Asserts cancellation, 0 handlers built, 0 framework builds and the restored environment. No change justified: the assertions cover the claimed contract. The reflection on private members is brittle but intentional to reach the race.
Pass B (80–89) new ServerTestHostTests.RunAsync_EndOfStreamCancelsAndDrainsInvocationBeforeDisposingServices Checks cleanup cancellation and drain ordering. No change justified.

No inline comments were published: I found no verified defect or supported change that I could anchor to a changed line. Existing Copilot reviewer threads were not duplicated.

<sub>This advisory review is heuristic and non-blocking.

Re-run the combined review with /review-tests, or only the parallel-safety specialist with /parallel-audit.</sub>

🤖 Automated content by GitHub Copilot. Generated by the Test Quality Review on PR (on open / sync) workflow. · copilot · auto (Claude Sonnet 5.5) · ~58 AIC · ⌖ ~2 AIC · ⊞ 8.5K

@microsoft-github-policy-service microsoft-github-policy-service Bot added the state/needs-review Awaiting review from the team. label Nov 27, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. state/approved Proposal approved; ready for implementation. labels Nov 27, 2026

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.

🔵 Needs a closer look

Cross-product protocol and scheduling changes require maintainer review because shipping/dependency flow and cancellation edge cases remain unverified, and local-only run artifacts prevent independent verification.

No open issues 🎉

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Final test-triage resolution — Azure Pipelines build 1702498

Resolution: no actionable test defect; the evidence is incomplete, so this is inconclusive rather than clean.

  • Build result: the build succeeded. The collector normalized 43,236 results: 42,312 passed, 916 skipped, 8 failed. No retry attempts or flaky markers were present.

  • Failed records: all 8 come from Windows_App_Model_Diagnostics_Attempt1, and all are TRX files produced by acceptance-test sample apps under artifacts/tmp/Release/testsuite/... or artifacts/log/Release/.... They are not from the repo's own test legs.

    • NativeTests.Outcome (3 files): Assert.IsFalse(fail) with message "expected host failure".
    • WinUIMtpPackagedApp.UnitTest1.RetryFailsFirstAttempt (1 file): its message says it "deliberately fails the first retry attempt".
    • PackagedWinUI...RetryTestMethod_PassesOnSecondAppContainerHost (1 file): the first AppContainer host is meant to fail so Retry activates a second host.
    • ModernUwp...InheritedClassDeployment and InheritedMethodDeployment (2 files): the message says DeploymentItemAttribute is not supported by UWP/WinUI hosts.
  • Assessment: these messages match failures that the acceptance tests provoke on purpose in generated assets, and the build still succeeded. This is my reading of the messages and file paths, not a confirmed root cause. Confidence: medium-high. No issue is warranted, since there is no recurrence evidence and no fail-then-pass proof.

  • Slowness: 27 candidates were collected, but none met the regression threshold (slowRegressionCount is 0).

  • Crash diagnostics: TestResults_Linux_Release_Attempt1 holds a binary dump, MSTest.Acceptance.IntegrationTests_112856_crash.dmp. No textual crash report or sequence file was supplied, so I could not tell whether it is an intentional crash scenario or a real host crash. Binary dumps are not exposed to this analysis. If someone suspects a real crash, a matching-OS (Linux) diagnostic session is needed to inspect the dump. The Linux Release job still passed.

  • Incomplete evidence: evidenceIncomplete is true because 2 artifact downloads failed (artifactDownloadFailures is 2). This conclusion therefore does not claim those legs are clean.

Next step: none required unless the Linux dump turns out to be unexpected.

🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · copilot · auto (Claude Sonnet 5.5) · ~31 AIC · ⌖ ~1 AIC · ⊞ 11.1K

@Evangelink
Amaury Levé (Evangelink) merged commit 641c5a6 into main Nov 27, 2026
35 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/multi-module-invocation-hooks branch November 27, 2026 13:53
@github-actions github-actions Bot removed the state/approved Proposal approved; ready for implementation. label Nov 27, 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.

3 participants