-
Notifications
You must be signed in to change notification settings - Fork 120
Closed
Description
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 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:
((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:
cat script.sh | parallel
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 with hedgehog as well: hedgehogqa/haskell-hedgehog#547
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels