Repository navigation
test(mecatui): eliminate real polling waits with virtual time - #1919
Merged
Merged
Conversation
Execute the existing open/copy polling assertions inside synctest bubbles, preserving the production interval and eliminating real timer waits. Co-Authored-By: mecatl <[email protected]>
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.
Summary
Run the existing open/copy cases in
TestMCPAuthorizationOpeningOrCopyingStartsPollinginside isolatedtesting/synctestbubbles.This removes the two real three-second polling waits while retaining the production polling command, production interval, injected controller/browser/clipboard fakes, and every existing assertion. No production code or timing configuration changes.
T.Runremains outside each bubble; the model uses the bubble-ownedt.Context().Measured benefit
Same targeted test, forced uncached with
-count=1:These are per-test execution times from
go test -json, not estimates based on command counts or claims about whole-suite speedup.Verification
cmd/mecatui/uipackage passed.-race:go test -race -count=20 -run '^(TestMCPAuthorization|TestMecatuiBrokerPollingLiveness)' -timeout 120s ./cmd/mecatui/uirechecks = 0, want 1; the mutation was reverted and the test passed again.git diff --checkpassed.Scope and readiness
Routine: test-only replacement of wall-clock waiting with the standard library's virtual-time test support. No interface or behavior changes, assertion removal, or documentation changes.
Draft because repository-wide final lint/test/race gates have not been run for this candidate. The focused and package checks above are complete; this PR does not claim completion of the aggregate pre-ready gates.