Skip to content

ci: stabilize MCP tests, run SingleStepTest on Linux only on master - #2504

Merged
kevinferrare merged 2 commits into
masterfrom
ci/sanitize-tests
Nov 11, 2026
Merged

kevinferrare merged 2 commits into
masterfrom
ci/sanitize-tests

Conversation

@kevinferrare

@kevinferrare kevinferrare commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • McpHttpHost.Start now starts Kestrel synchronously on 127.0.0.1, accepts port 0, exposes the bound Port and throws on bind failure. Previously it returned before listening and swallowed bind errors, so the MCP tests' 0.4 s port polling timed out on the saturated macOS runner.
  • MCP tests bind port 0; the racy free-port probe and the polling loop are removed. One new test pins that a busy port throws IOException, which Spice86DependencyInjection now catches to keep MCP optional.
  • nuget.yml runs SingleStepTest on Linux only, like pr.yml.
  • Generated-source dump writes are serialized: parallel tests sharing a golden key wrote the same file at once, which fails on Windows.

Note: MCP now listens on IPv4 loopback only (no ::1).

Test plan

  • dotnet test --project tests/Spice86.Tests -- --filter-class '*Mcp*'
  • CI green on macOS / Windows / Linux

McpHttpHost started Kestrel on a background thread and swallowed bind
errors, so tests polled a probe-and-released port with a ~0.4s budget.
Under full parallelism on the 3-core macOS runner that budget expired.
Start now binds synchronously on 127.0.0.1 (port 0 allowed), exposes the
bound Port and throws on bind failure; tests use port 0 and no polling.

nuget.yml now runs SingleStepTest on Linux only, like pr.yml.
Copilot AI balanced review requested due to automatic review settings November 11, 2026 16:00

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Parallel tests sharing a golden key (the two DataStringsCheckedLiteralFailsOnMutatedBytes
cases and AsmScenarioTest's data_strings run) wrote the same generated-code file at once;
Windows fails the second writer with a sharing violation.
@kevinferrare
kevinferrare merged commit 5b0b794 into master Nov 11, 2026
5 checks passed
@kevinferrare
kevinferrare deleted the ci/sanitize-tests branch November 11, 2026 21:20
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