Test randomly hangs in CI #727
-
Hi, I've been using BUnit for a few months now and things are mostly going great. However, I'm now facing a weird issue that's hard to understand. One of my tests seems to sometimes not be able to finish executing. It seems to hang on WaitForState or WaitForAssertionCalls.
What the test does is as follows : We have a lot of these kind of tests and I can't see anything special with it but for some reason, only this one seems to be causing deadlocks or something of that nature when executing in CI. I have been able to reproduce it using the dotnet.exe CLI with a powershell script that runs the tests in a loop until it fails due to
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 14 replies
-
That might be related to #710 . Can you try the latest preview release? See #209 how to get the latest preview |
Beta Was this translation helpful? Give feedback.
-
I tried to run it locally, and this is the exception I received after a few iteractions:
Nope, inspected the memory dump and this is indeed related to #577. |
Beta Was this translation helpful? Give feedback.
-
Took a more detailed look at you test code. In
You are calling I changed the top of
and the test to this:
And now the test seems to be running without a problem (current at 75 iterations without fail, before it only lasted three iterations). So that does solve your particular problem, but besides that, we do have a deadlock possibility if people use Thanks for the sample code, it will make it much easier for me to create a fix. |
Beta Was this translation helpful? Give feedback.
Took a more detailed look at you test code.
In
EditerTestsBase
you have two properties,Edition
andRecherche
, that you use multiple times in your test. However, because you write them like this:You are calling
FindComponent
everytime you access the property, which is not only wasteful, but probably not what you want.I changed the top of
EditerTestsBase
to this: