Repository navigation
test(mcpx): testing/synctest pilot for elicit deadline tests (#2639) - #4934
Conversation
…2639) Pilot testing/synctest on the elicit component, the in-process piece whose tests touch no sockets and no subprocesses (the bubble rule). - TestAnAnswerCanComeFromAnotherProcess: synctest.Wait replaces the 50ms sleep-as-scheduler-hint; the waiter's 10s Await deadline and the 5s fallback timer are now virtual time, so an unwoken waiter fails in microseconds instead of after ten wall-clock seconds. - TestTouchNeverPassesTheMaxAgeCeiling and TestAnAbandonedQuestionStillExpires: their 600ms/450ms sleeps stay, but are virtual time — advancing the fake clock is exactly what those tests assert (ceiling clamp, ttl expiry), and they no longer cost wall time. No production change: test-only edit, no clock seam needed.
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. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
agent-note:v1 state: opened (task 8041, lane bf419306-c4ef-470f-a553-beabf93239de) |
|
🤖 Agent note · handed off
|
|
agent-note:v1 Claimed for fresh CI-trigger investigation. The packet has a bound follow-up PR; I am verifying current ownership before any edits. |
|
agent-note:v1 Fresh blocker: bound PR #5511 is OPEN, authored and assigned to Drew. Per queue guardrails I did not edit, relabel, or comment on #5511, and did not open a competing PR. PR #3033 and #2929 are also open drafts touching Resume condition: Drew explicitly hands off/reassigns/closes #5511 and the overlapping draft-PR ownership is clear. Task 8631 is parked for 30 minutes with that condition recorded. |
Fixes #2639.
Summary
Pilot
testing/syncteston elicit — the component chosen by triage (task 7951) because its tests touch no real network and start no subprocesses, which is the bubble rule. Three tests move into a synctest bubble:TestAnAnswerCanComeFromAnotherProcessAwaitdeadline and 5s fallback timer on the wall clocksynctest.Wait()until the waiter is blocked inAwait; both timers are virtual timeTestTouchNeverPassesTheMaxAgeCeilingTestAnAbandonedQuestionStillExpiresRemaining
time.Sleepcalls are the two deliberate virtual-clock advances (justified inline in the test comments) — no sleep-as-scheduler-hint polling is left in the converted tests. No production change, no clock seam needed:testing/synctestis stable since Go 1.25 andpkgs/mcpx/go.moddeclares go 1.27.2.Evidence
go test ./internal/elicit -run 'TestAnAnswerCanComeFromAnotherProcess|TestTouchNeverPassesTheMaxAgeCeiling|TestAnAbandonedQuestionStillExpires' -count=10 -v— 30/30 pass (10 iterations × 3 tests), 8.7s total.go test ./internal/elicit -count=1— ok (whole package, 7.0s vs. ~6.2s before; the converted tests no longer sleep).go vet ./internal/elicit— clean;gofmt -l— clean.pkgs/mcpx go test ./...) covers the package suite on the PR.Scope
Pilot only. The two race tests (
respond_race_test.go,expire_race_test.go) were inspected and have notime.Sleeppolling — their conversion is deliberately not in this PR; converting further components stays follow-up work per the issue.Merge Danger
Door: two-way (test-only under
pkgs/mcpx/internal/elicit)Blast Radius: none on shipped code — a test file change; worst case is a test that needs its bubble shape adjusted.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.