Skip to content

test: poll goroutine count to deflake TestSubscribeWithContextDone - #191

Open
c-tonneslan wants to merge 1 commit into
r3labs:masterfrom
c-tonneslan:fix/flaky-subscribe-context-done-test
Open

test: poll goroutine count to deflake TestSubscribeWithContextDone#191
c-tonneslan wants to merge 1 commit into
r3labs:masterfrom
c-tonneslan:fix/flaky-subscribe-context-done-test

Conversation

@c-tonneslan

Copy link
Copy Markdown

Closes #186.

The fixed 1-second sleep after `cancel()` was racing the subscriber goroutines on busy CPUs. The Debian packagers can repro reliably with `taskset -c 0,1 go test`.

Swap the sleep for a 10-second polling loop. The test still fails in a reasonable time if the goroutines genuinely leak, but it doesn't blow up just because the scheduler got slow.

The fixed 1 second sleep after cancel() was racing the subscriber
goroutines on busy CPUs. The Debian packagers can reproduce it with
'taskset -c 0,1 go test' (r3labs#186).

Replace the sleep with a 10s polling loop. The test still fails in a
reasonable time if the goroutines genuinely leak, and it doesn't fail
on a slow scheduler.

Closes r3labs#186

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
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.

Flaky test: TestSubscribeWithContextDone

1 participant