Repository navigation
test(docs): stop the guest busy resend test from hanging - #181
Merged
Merged
Conversation
A writer that returned early through t.Error never called firstRound.Done, so the flood never stopped and the test ran until the package timeout without reporting its error.
oesni
force-pushed
the
fix/guest-busy-test-hang
branch
from
October 24, 2026 15:38
3ce07ed to
0c317b2
Compare
The test runs ten guest writers against a flood, and its busy answers and the receipts that keep writers under the guests' 4 MiB output limit depend on the worker keeping up with the wall clock. Run in parallel with the rest of the docs shard on a CI runner, the worker fell behind and closed every writer: first as slow consumers, then with read timeouts. Make it a serial test in the docs-budget shard, as the other refill-rate tests are, and report a writer's close reason.
oesni
force-pushed
the
fix/guest-busy-test-hang
branch
from
October 24, 2026 15:38
0c317b2 to
12d62ef
Compare
It now runs in the docs-budget shard with the other tests that depend on the wall clock, and like them it no longer calls t.Parallel, so a local go test of the package runs it alone too.
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
TestGuestBusyResendKeepsOrder(added in #180) hangs thetest (docs)shard until the 10-minute package timeout. Main44dfd74fails this way (run 40100896738), and so does every PR whose CI merges main, for example #174. This change makes the test report failures instead of hanging, fixes the failure, and runs the test with the other wall-clock tests.Only test code and the CI shard script change. Product code does not.
Cause
firstRoundwas never released. The flood goroutines therefore never stopped, and the writers' own errors were never reported.connection closedafter about 45 s. Every update reaches the other nine writers, and guests share 4 MiB of unconfirmed output (LIMITS.publicSendBytes). Parts of 4,000 characters added up to about 4.9 MB, so a worker slowed by the flood closed every writer as a slow consumer before their receipts arrived.Changes
dcb63e2: every writer exit releases its first round once (sync.OnceFunc, deferred), so the flood stops and the test fails with the reader's error instead of hanging.12d62ef: parts are 1,000 characters, which keeps the fan-out near 1.3 MB. The test moves to thedocs_budgetshard inscripts/ci-test.sh, which runs the tests that depend on the wall clock.9d622dc: the test no longer callst.Parallel(), like the otherdocs_budgettests, so a localgo testof the package runs it on its own as well.The test still requires at least one
busyanswer and still checks that every part lands once and in order, so the smaller parts do not let it pass without exercising busy and resend.Verification
12d62ef: all checks passed (commit-imagesskipped), includingtest (docs)andrace.9d622dc: the test passed 3 of 3 runs, with 100 busy answers each.scripts/ci-test.sh docs-budget -count=1passed.go vet ./internal/apps/docsis clean.Note for later
Readers in this test confirm every frame they receive, but writers were still closed as slow consumers while the flood delayed the worker. Several people editing a large document quickly beside heavy visitor traffic could hit the same limit. This PR changes only the test. Whether the shared output budget should behave differently is a separate question.