Skip to content

Flaky test: TestSubscribeWithContextDone #186

@n-peugnet

Description

@n-peugnet

While packaging this library in Debian, we noticed that the test TestSubscribeWithContextDone is flaky. It can fail, for example when the machine has a high load while running the tests:

[...]
=== RUN   TestSubscribeWithContextDone
    client_test.go:423: 
        	Error Trace:	client_test.go:423
        	Error:      	Not equal: 
        	            	expected: 32
        	            	actual  : 30
        	Test:       	TestSubscribeWithContextDone
--- FAIL: TestSubscribeWithContextDone (2.00s)
[...]

One way to reproduce this failure reliably is to pin the execution on a few CPUs, for example with taskset (thanks Santiago Vila for the reproducer):

$ taskset -c 0,1 go test
--- FAIL: TestSubscribeWithContextDone (2.00s)
    client_test.go:423: 
        	Error Trace:	client_test.go:423
        	Error:      	Not equal: 
        	            	expected: 30
        	            	actual  : 28
        	Test:       	TestSubscribeWithContextDone
FAIL
exit status 1
FAIL	github.com/r3labs/sse/v2	12.500s

See also: https://bugs.debian.org/1098392

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions