Repository navigation
test(logs): the no-gap test no longer depends on how fast its reader runs - #16
Merged
Merged
Conversation
…runs Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
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.
What
TestSubscribeHasNoGapOrDuplicatewrote 1500 lines after subscribing while a goroutine drained the subscriber's 256-line channel. When the reader fell behind, the sink dropped lines, as it is designed to, and the test failed (not contiguous at 793: "792" then "881"). This failed theverifyjob of the v0.2.7 Release run.The test now writes at most 200 lines after the subscription, fewer than the channel holds, so nothing can be dropped however slowly the reader runs. The assertion is unchanged.
Product code
Unchanged. The sink drops lines for a viewer that falls more than 256 lines behind; that is the documented behaviour.
Checked
go test -race -count=300 -run TestSubscribeHasNoGapOrDuplicate ./internal/logsink/and the same withGOMAXPROCS=1pass; the whole package passes 20 times under the race detector.