Repository navigation
test(editormcp): bound the waits in the per-call notice test - #2726
Merged
Merged
Conversation
The test read notices with bare channel receives. When its first version selected an object the fixture does not have, no notice came and the receive blocked until the 20-minute package deadline killed the binary, which nsgo test reports only as "the test process exited before reporting an outcome". Each wait now times out after five seconds and names the notice it was waiting for, as TestChangeStream already does.
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.
Follow-up to #2716.
Why
A
-count=30run of the first version ofTestChangeStreamSendsOneNoticePerToolCallfailed with onlythe test process exited before reporting an outcome. The log showspanic: test timed out after 20m0s: the test selected"ghost", which the fixture scene does not have, so no notice was sent and a bare<-gotblocked until the package deadline. #2716 fixed the object, but the receives stayed unbounded, so any future missing notice would again hang the whole package instead of failing the test.Change
The three receives go through one
want(by)helper that times out after 5 s withtimed out waiting for the selection by <who>, asTestChangeStreamalready bounds its own waits. Test-only; no behaviour change.Verification
go tool nsgo test ./pkg/editor/editormcp -- -run '^TestChangeStream' -count=30 -race -cpu=1,4on macOS arm64: 120 passed, 0 failed."ghost": the test fails in 5.1 s withtimed out waiting for the selection by personinstead of hanging for 20 minutes.Screenshots
None.