goczmq icon indicating copy to clipboard operation
goczmq copied to clipboard

go test: fails randomly in channeler_test.go with Errorf: timeout

Open cyrilleverrier opened this issue 6 years ago • 0 comments

Steps to reproduce: make test / go test -v / go test -v -race

Some of the tests fail randomly with t.Errorf("timeout") when trying to receive a new message from the subscriber channel.

Explanation: A message is sent to the SendChan just after the subscriber with a RecvChan has been created. I guess that the subscriber doesn't have enough time to run its internal go-routine and the message sent in the unit test is lost.

New functions like NewSubChanneler should exit only after the go-routine in the subscriber is polling new messages from the zeromq sock.

cyrilleverrier avatar Feb 22 '19 13:02 cyrilleverrier