Repository navigation
[compass] Clean up tests: fixed waits in four quick checks (5 s faster) - #33
Merged
Merged
Conversation
…aster) - MCP ownership: once the stale stand-in's pipe is listed, its backend connects with a 50 ms wait, so the two calls after the quit fail fast instead of each waiting out the 1 s default. - MCP lease helper: poll the lease until the waiter is in line instead of sleeping 1.5 s. - agent deadline replies: the read-only and command-start cases use 300 ms deadlines (their time text isn't asserted); the queued 800 ms and the held 1.5 s cases keep their asserted messages. - pipe forwarded time left: queue the request 0.6 s instead of 1.5 s, with the same 100 ms and 3 s margins. - desktop ignored set_value: drop `window.Value == "Free"`, which only restates the stand-in's reset (its "ignore" mode never writes the value). No product code changes; every other assertion is unchanged. Reviewer question: does any changed or removed assertion lose the only coverage of a behaviour, or make a check timing-sensitive on a slow CI runner in a way the old values weren't? Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The quick self-test spends most of its time in fixed waits. This makes four checks wait for the condition they need instead, which saves 5.0 s (15%) per
selftest --quickrun: 32.8 s → 27.9 s. Every assertion is kept except one that can't fail, and product coverage is unchanged line for line. Product code is untouched.What changed
McpServer's default 1 s connect to the closed pipe.ConnectTimeoutMs = 50, asMcpChecks.DiscoveryandChannelChecksalready use. It is set only after Windows lists the stand-in's pipe (SeatSlot.Pipes(), bounded at 5 s), becauseJsonPipeServer.Start()opens its first instance on a background task and a 50 ms connect could otherwise race it on a slow runner.LeaseEnded, the token dropped, the acquire hint, no launch and no readiness call.await Task.Delay(1500)for the waiter to join the line.desktop.wait) and command-start (exec.start) cases ran with 1,000 ms deadlines and waited out 875 ms each.StopAfterMs's eighth branch and theN msmessage branch. The queued 800 ms and held 1.5 s cases are unchanged, so the asserted "800 ms" and "1.5 s" messages and log lines (the nearest cases to the 1,000 ms format switch) still pin the format.timed_out,startedand message assertions.left <= 8000 - 1400 && left > 8000 - 4500.left <= 8000 - 500 && left > 8000 - 3600. That keeps the same 100 ms early margin and 3 s late margin, and stays well aboveTimeLeft's 100 ms floor. The "starved" case (1,000 ms deadline, 960 ms wait) is unchanged: its 60 ms margin against aTickCount64clock leaves no room to shrink it.Require(window.Value == "Free" && watch.ElapsedMilliseconds >= ...)window.Value == "Free". In "ignore" mode the stand-in'sSetValuenever writes_value, andUse()has just reset it to "Free", so that conjunct only restates the fixture and no product change can make it fail.Before and after
Measured on main 98173de against this branch, with Release builds run alternately (main, branch, ×3) on the same PC:
anode selftest --quickwall timebuild.ps1 -QuickTest(publish, self-test, docs check)Mutation check
Product mutations aimed at the changed checks (
mutate.py: apply, build Debug, runselftest --quick, restore byte for byte). With this branch's checks, every one is caught by the check named:exec.startcasedesktop.waitsaid to have acteddesktop.waitcaseThe same nine mutations (O1 to F2) against main's checks, as a control: all nine caught too. D1 and D2 are caught by the unchanged held 1.5 s case before the shortened cases run, so D4 was added to show that the 300 ms read-only case catches on its own.
On this PR's CI run (38024123972) the changed checks took 136 ms (MCP ownership), 1,006 ms (MCP lease helper), 2,558 ms (agent deadline replies) and 1,569 ms (pipe forwarded time left), the same as on this PC.
Second review
codex exec review --base main(gpt-6-astra,sandbox: read-only, through the Compass wrapper): "No actionable regressions were found in the test-only changes. The revised timing and polling remain consistent with the code being tested." The routine's question (does any changed or removed assertion lose the only coverage of a behaviour, or add timing sensitivity) was put to it in the commit message. A separate read-only audit of the checks added in #20 to #32 found thewindow.Valueconjunct above as the only useless assertion. Everything else in those checks pins its own path.Auto-merge by compass-merge at its next run if tests pass. Add the hold label or leave a comment to stop it. (This repository has no
holdlabel, so a comment holds it.)🤖 Generated with Claude Code