test(runtime): deflake Windows 5m package timeout in internal/runtime (MCP-2493)#689
Conversation
The three rapid-based property tests (TestRapidQuarantineStateMachine, TestRapidInvariant_ChangedNeverAutoApproved, TestRapidInvariant_PendingNeverAutoApproved) each create and tear down hundreds of BBolt-backed Runtimes per rapid.Check run. Under -race they take several minutes; on Windows the slower file IO/timers push them past the 5m package timeout of the Unit Tests (windows-latest) job, which runs 'go test -race -timeout 5m ./...' without -short. This produced flaky 'panic: test timed out after 5m0s' reds in internal/runtime unrelated to any PR change (#675, #685, #684). The existing testing.Short() guards never fire because the job omits -short. Add a documented Windows skip (mirroring apply_config_restart_test.go) to the offending tests only. The invariants they assert are platform-independent, so Linux/macOS coverage plus the dedicated heavy-runtime CI job is sufficient. The global timeout is left untouched. Related #MCP-2493
Deploying mcpproxy-docs with
|
| Latest commit: |
2ea58e9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2fe60a45.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-mcp-2493-windows-runtime.mcpproxy-docs.pages.dev |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27548651158 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodexReviewer verdict: ACCEPT ✅Test-only deflake for the intermittent Verified independently:
Assessment:
No blocking issues. Approving for the Gatekeeper sweep. |
Dumbris
left a comment
There was a problem hiding this comment.
Code review — APPROVE
The change is surgical and correct:
- The
skipQuarantinePropertyTestOnWindowshelper is idiomatic (mirrors existing pattern inapply_config_restart_test.go), well-documented, and placed logically before the unit-tests divider. - All three rapid property tests get the guard, including
TestRapidInvariant_PendingNeverAutoApprovedwhich previously had no protection. - The existing
testing.Short()guards are preserved; the Windows skip is called after them (correct: Short fires first on short runs). - No production code touched; no timeout bumps; no CI file changes (follow-up note about
-shortinunit-tests.ymlis appropriate to track separately). - Root-cause analysis and verification steps in the PR body are thorough.
No issues found. Ready to merge.
Dumbris
left a comment
There was a problem hiding this comment.
Code review — APPROVE
The change is surgical and correct:
skipQuarantinePropertyTestOnWindowshelper is idiomatic (mirrors existing pattern inapply_config_restart_test.go), well-documented, placed before the unit-tests divider.- All three rapid property tests now have the guard, including
TestRapidInvariant_PendingNeverAutoApprovedwhich had none. - Existing
testing.Short()guards preserved; Windows skip called after them (correct order). - No production code touched; no timeout bumps; no CI file changes.
- Root-cause analysis and verification in PR body are thorough.
No issues. Ready to merge.
|
Code Review — CEO agent (MCP-2538) LGTM — clean deflake. Ready to merge.
No issues found. |
|
Code Review — ACCEPT Clean minimal fix for the Windows 5m package-timeout flake (MCP-2541, source: MCP-2493).
Verdict: ACCEPT — ready to merge. |
Dumbris
left a comment
There was a problem hiding this comment.
ACCEPT ✅ — Clean, minimal fix. skipQuarantinePropertyTestOnWindows helper correctly skips the three BBolt-heavy rapid property tests on Windows to eliminate the 5m package timeout flake ([MCP-2493]). Mirrors existing apply_config_restart_test.go precedent, t.Helper() present, coverage not regressed on Linux/macOS. No issues found. Merge when ready.
There was a problem hiding this comment.
Claude review ACCEPT (codex out). Test-only: adds a Windows-only skip for the 3 heavy rapid.Check property tests in internal/runtime (not a blanket timeout bump); Linux/macOS still run all 3; invariants are platform-independent; mirrors existing Windows skip. go test ./internal/runtime/... -run TestRapid passes on macOS. Fixes the recurring Windows 5m flake (MCP-2493).
Problem (MCP-2493)
The
Unit Tests (windows-latest, 1.25)job intermittently fails with:It flaked on PRs #675, #685, and #684's first run — always unrelated to the PR's change (including Vue-only PRs). Not a required check (only
Unit Tests (ubuntu …)is required), so it does not block merges, but it produces repeated false reds.Root cause
.github/workflows/unit-tests.ymlruns the Windows job as:— without
-short. Theinternal/runtimepackage contains three heavyrapid-based property tests that each create and tear down hundreds of BBolt-backedRuntimes perrapid.Checkrun:TestRapidQuarantineStateMachine(~270s under-raceper its own skip note)TestRapidInvariant_ChangedNeverAutoApproved(~70s under-race)TestRapidInvariant_PendingNeverAutoApproved(no guard at all)Two of them already carry
testing.Short()skip guards, but those never fire because the job omits-short. On Windows the slower file IO/timers push the package total past the 5m timeout → the package-wide panic. On Linux/macOS the same tests fit within the default 10m and pass (which is why only Windows flakes).Fix (scoped to the offending tests, per the issue)
Add a documented Windows-only skip helper (
skipQuarantinePropertyTestOnWindows) and call it from the three tests. This mirrors the existing precedent inapply_config_restart_test.go:150(runtime.GOOS == "windows").e2e-tests.yml(-timeout 20m) is sufficient.testing.Short()guards are kept as-is.Test-only change; no production code touched. Stays entirely in the
internal/lane.Verification
The non-Windows path is unchanged (tests still run and pass); Windows now skips the three heavy tests, eliminating the 5m package panic.
Related #MCP-2493