You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enforce cancellation propagation, single invocation, downstream failure preservation, and drain-before-lifetime-cleanup behavior
add localized diagnostics, API baselines, documentation, and focused regression coverage
Scope
This is the first composition increment. It intentionally does not implement typed multi-run Retry, Stress, Sharding, Hot Reload, or protocol metadata composition. Middleware must begin its single next invocation before returning or throwing; it may observe the returned task asynchronously, but cannot defer the call itself.
Validation
build.cmd platform and unit-test project builds passed for net8.0, net9.0, netstandard2.0, and net462
34 middleware/orchestrator/API metadata tests passed on net8.0, net9.0, and net462
full net8.0 unit suite: 2655 passed, 2 pre-existing Windows named-pipe security failures reproduced on the unmodified baseline
three independent architecture/code/API review rounds plus a final post-fix code review completed
This keeps the next gate open until the middleware task completes, so a middleware such as async (next, ct) => { await Task.Yield(); return await next(ct); } is accepted even though it defers the call until after OrchestrateTestHostExecutionAsync has returned its task. That contradicts the PR/API contract that next must begin synchronously. Capture the middleware task first, close the guard immediately after the call returns (or throws), and only then await that task; add a regression using an initial incomplete await before next.
The guard stays open for the entire middleware task, so async middleware can await Task.Yield() and invoke next only afterward. That invocation is accepted even though the public contract and PR scope require next to begin before the middleware call returns. Close the guard immediately after obtaining the middleware task (before awaiting it), and add a regression for a deferred next call.
This issue also appears on line 136 of the same file.
Final test-triage resolution — Azure Pipelines build 1615940
Result: one deterministic test failure in the Windows Debug leg, in the "Test (unit tests only)" step. Confidence is medium. The evidence is complete (evidenceIncomplete=false).
Failing test:StartAsyncTimeoutKillsProcessAndReleasesListener [net8.0], in Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests (MtpServerProcessTests.cs:79).
It failed in both attempts of the leg (Attempt1 and Attempt2), with no passing attempt in between, so it is not proven flaky.
The assertion expects the message to contain did not connect back within.
The actual message was The Microsoft.Testing.Platform application '...\NeverConnects.cmd' exited with code 0 before connecting back.
The stub process exited before the timeout fired, so the "timeout kills process" path was never exercised.
History: the same test passed (about 3.5 s) in the most recent successful branch build, 20260929.29. The other 11 sampled builds have no matching record for it, so the history shows no prior failure of this signature.
Other signals:
The Windows_App_Model_Diagnostics record RetryTestMethod_PassesOnSecondAppContainerHost is reported as failed in appcontainer-retry.trx. This is a retry-verification asset that is designed to fail on the first host, and nothing else links it to this build failure. I treated it as non-actionable.
There are no crash or hang diagnostics and no slowness regressions.
No other test failures were found.
Assessment: this looks like a failure tied to this pull request, or to a Windows-specific behavior of the .cmd stub, rather than a durable defect. No issue was created, because there is no recurrence across independent builds. The pull request changes host and orchestrator code under src/Platform/Microsoft.Testing.Platform/Hosts/, which is plausibly related, but I did not confirm a root cause.
Next step: reproduce locally on Windows with MtpServerProcessTests, and check whether the stub .cmd exits immediately (exit code 0) under the changed host or process startup path. If it does, fix the test or the product code accordingly.
🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · copilot · auto · 28.9 AIC · ⌖ 6.17 AIC · ⊞ 9.6K
A genuinely canceled downstream task is wrapped unless the linked token also happens to be canceled. For example, if the orchestrator returns Task.FromCanceled<int>(anIndependentCanceledToken) and middleware starts next but returns a failure code, DownstreamTask.IsCanceled is true while EffectiveToken.IsCancellationRequested is false; execution falls into the generic catch and reports InvalidOperationException instead of preserving cancellation as the public contract requires. Include the task's canceled state in this filter and add a regression for independent downstream cancellation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scope
This is the first composition increment. It intentionally does not implement typed multi-run Retry, Stress, Sharding, Hot Reload, or protocol metadata composition. Middleware must begin its single
nextinvocation before returning or throwing; it may observe the returned task asynchronously, but cannot defer the call itself.Validation
build.cmdplatform and unit-test project builds passed for net8.0, net9.0, netstandard2.0, and net462