goczmq
goczmq copied to clipboard
go test: fails randomly in channeler_test.go with Errorf: timeout
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.