sydTest (and most related functions, such as sydTestResults, ...) cannot be run twice in a concurrent environment because they internally relies on non thread safe features.
I wanted to track in a ticket that sydTest cannot be run concurrently, so if someone hit a segmentation fault, maybe they'll find this ticket. I'm unsure sydtest should be fixed (e.g. the fix would be highly invasive and complex), however maybe the documentation may list the "unsafe" functions.
sydTest
(and most related functions, such assydTestResults
, ...) cannot be run twice in a concurrent environment because they internally relies on non thread safe features.Especially (but maybe not exhaustive):
withArgs
, which is not thread-safe according to https://gitlab.haskell.org/ghc/ghc/-/issues/18261The following code will hence hapilly segfault:
Built with
-O2 -threaded
and run with--continuous +RTS -N
and you'll eventually get a segfault.This is not a problem in traditionnal uses of sydtest, however, it is a problem when using sydtest in the sydtest test suite itself. That's what I tried when working on #80 (especially, see comment https://github.com/NorfairKing/sydtest/issues/80#issuecomment-2286446001).
Note that a workaround is to use "internal" functions which does not do the detection, such as:
I wanted to track in a ticket that sydTest cannot be run concurrently, so if someone hit a segmentation fault, maybe they'll find this ticket. I'm unsure sydtest should be fixed (e.g. the fix would be highly invasive and complex), however maybe the documentation may list the "unsafe" functions.