Skip to content

test(logs): the no-gap test no longer depends on how fast its reader runs - #16

Merged
rjd15372 merged 1 commit into
mainfrom
fix/logsink-flaky-test
Nov 12, 2026
Merged

rjd15372 merged 1 commit into
mainfrom
fix/logsink-flaky-test

Conversation

@rjd15372

Copy link
Copy Markdown
Collaborator

What

TestSubscribeHasNoGapOrDuplicate wrote 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 the verify job 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 with GOMAXPROCS=1 pass; the whole package passes 20 times under the race detector.

…runs

Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
@rjd15372
rjd15372 merged commit 6380274 into main Nov 12, 2026
5 checks passed
@rjd15372
rjd15372 deleted the fix/logsink-flaky-test branch November 12, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant