When a test spawns a new thread, madsim will panic with "attempt to spawn a system thread in simulation.", which is good for catching one specific kind of determinism breakage.
However I still see benefits of using madsim's seeded RNG with regular tests, as it helps narrowing down the possible causes of a failure, especially for property-based testing. I would like to propose adding a new environment variable that would disable the said check.
I am currently testing with the check removed, I also had to insert a sleep if going == false in the block_on loop.
Thanks for the quick fix again :heart: , there is just one more thing that I mentioned on the last line that enables awaiting on events triggered by the thread.
When a test spawns a new thread, madsim will panic with "attempt to spawn a system thread in simulation.", which is good for catching one specific kind of determinism breakage. However I still see benefits of using madsim's seeded RNG with regular tests, as it helps narrowing down the possible causes of a failure, especially for property-based testing. I would like to propose adding a new environment variable that would disable the said check.
I am currently testing with the check removed, I also had to insert a
sleep
ifgoing == false
in the block_on loop.