enriquebris/goconcurrentqueue

TestDequeueOrWaitForNextElementMultiGR stuck when executed on single proccess

Closed this issue · 4 comments

While testing #19 I noticed Travis testing is timing out. This problem also occurs on master, therefore this issues. I was able to replicate this problem on my computer by limiting the maximum processes: GOMAXPROCS=1 go test -test.v

The test that gets stuck is
TestFixedFIFOTestSuite/TestDequeueOrWaitForNextElementMultiGR

I have tried debugging by adding print statements through the test but I can't figure out what's wrong. I did find that lowering WaitForNextElementChanCapacity from 1000 to 500 makes the test succeed, but I don't think this solves the root problem.

Does anyone have an idea what could cause this?

Thanks for this amazing package, I am having a lot of fun working in this nice codebase.

Oh and to make this whole even more vague, sometimes Travis does succeed! Although replicating this on my computer it always fails... So I tried searching for race conditions but couldn't find any.

Hi @SijmenHuizenga,

I'm going to go deep in this issue (starting in local env). Thank you for your notes, I'm sure they will help me.

@SijmenHuizenga
Done, the testing issue is already solved (FixedFIFO.TestDequeueOrWaitForNextElementMultiGR), both for local environment and for travis-ci.

Code modifications: #21

Regarding your question:

Does anyone have an idea what could cause this?

In some random cases (for example: GOMAXPROCS=1) the listener goroutines were not ready before the queue gets populated.

Please could you test this update (already merged against master) in your local?: GOMAXPROCS=1 go test -v

Good catch, thank you!

Amazing! I tested it and it works flawlessly. Thank you for the quick solution ❤️