Skip to content

Stabilize MTP server timeout test - #11655

Merged
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
evangelink-fix-mtp-server-timeout-flake
Sep 30, 2026
Merged

Amaury Levé (Evangelink) merged 1 commit into
mainfrom
evangelink-fix-mtp-server-timeout-flake

Conversation

@Evangelink

Copy link
Copy Markdown
Member

The Windows timeout test could race the timeout path with natural exit of its short-lived batch script, causing it to assert the wrong startup-failure message. The test now keeps the batch process alive with a test-controlled release file, then verifies that no survival marker is written after teardown and that the listener can still be rebound.

Fixes: #11631

Validation

  • \.\build.cmd -projects .\test\UnitTests\Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests\Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests.csproj -binaryLog - passed.
  • The flaky test run 10 times with \.\.dotnet\dotnet.exe exec ... --filter "FullyQualifiedName~MtpServerProcessTests.StartAsyncTimeoutKillsProcessAndReleasesListener" - passed 10/10.
  • \.\.dotnet\dotnet.exe test --project .\test\UnitTests\Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests\Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests.csproj --framework net8.0 --no-build - passed (282 passed, 8 skipped).

Copilot AI balanced review requested due to automatic review settings September 30, 2026 09:51
@github-actions github-actions Bot added the needs/merge-conflict-resolution PR has merge conflicts that must be resolved. label Sep 30, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Evangelink
Amaury Levé (Evangelink) force-pushed the evangelink-fix-mtp-server-timeout-flake branch from eb511cf to e415d02 Compare September 30, 2026 09: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.

Copilot review overview

🟢 Approval recommended

The focused test stabilization removes the reported race without weakening process-kill or port-release coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Stabilizes the Windows MTP server timeout test by keeping its batch process alive until teardown is verified.

Changes:

  • Adds a release-file rendezvous to prevent natural process exit.
  • Verifies process termination and listener rebinding.

Confidence at a glance

🟢 Test-only change aligns with issue #11631 and preserves meaningful teardown assertions.

File Description
test/​UnitTests/​Microsoft.Testing.Platform.ServerMode.Client.Sources.UnitTests/​MtpServerProcessTests.cs Makes timeout teardown verification deterministic.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@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 Sep 30, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit ca08f97 into main Sep 30, 2026
16 of 21 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the evangelink-fix-mtp-server-timeout-flake branch September 30, 2026 10:08
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the state/needs-review Awaiting review from the team. label Sep 30, 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.

Flaky: MtpServerProcessTests.StartAsyncTimeoutKillsProcessAndReleasesListener races between timeout and early-exit failure

2 participants