When using tasty to run a hedgehog property that does simple IO (for example reading a file), the process can occasionally hang indefinitely.
The code for reproducing the hang can be found here: https://github.com/newhoggy/tasty-hang
The reproducer contains three executables:
tasty-hang-bad - This executable uses tasty to invoke a hedgehog property that has withTests 1 and no generators, which effectively makes it a unit test. The test reads a small file. This can hang when run often enough.
tasty-hang-good - This executable uses hunit instead of hedgehog to read a small file. This has not been observed to hang.
tasty-hang-none - This executable invokes hedgehog directly form IO without using tasty at all. This has not been observed to hang.
I am running on Linux on WSL2 on Windows. The CPU has 32 cores.
To reproduce, I create a script file like this:
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-1.log 2> ../stderr-1.log)
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-2.log 2> ../stderr-2.log)
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-3.log 2> ../stderr-3.log)
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-4.log 2> ../stderr-4.log)
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-5.log 2> ../stderr-5.log)
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-6.log 2> ../stderr-6.log)
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-7.log 2> ../stderr-7.log)
((date >&2; for x in {0..99999}; do echo "== $x =="; echo "== $x ==" >&2; tasty-hang-none; done) > ../stdout-8.log 2> ../stderr-8.log)
Then I run each loop concurrently like this:
Then, in another terminal, I watch the progress of the run like this:
watch ls -la stdout-*.log
If any of the log files stop growing before the others, the associate process has hung.
This issue has been raised in with tasty as well: UnkindPartition/tasty#449
When using
tastyto run ahedgehogproperty that does simpleIO(for example reading a file), the process can occasionally hang indefinitely.The code for reproducing the hang can be found here: https://github.com/newhoggy/tasty-hang
The reproducer contains three executables:
tasty-hang-bad- This executable usestastyto invoke ahedgehogproperty that haswithTests 1and no generators, which effectively makes it a unit test. The test reads a small file. This can hang when run often enough.tasty-hang-good- This executable useshunitinstead ofhedgehogto read a small file. This has not been observed to hang.tasty-hang-none- This executable invokeshedgehogdirectly formIOwithout usingtastyat all. This has not been observed to hang.I am running on Linux on WSL2 on Windows. The CPU has 32 cores.
To reproduce, I create a script file like this:
Then I run each loop concurrently like this:
Then, in another terminal, I watch the progress of the run like this:
If any of the log files stop growing before the others, the associate process has hung.
This issue has been raised in with
tastyas well: UnkindPartition/tasty#449