avoid setEnv in test framework when tasty is running
authorJoey Hess <joeyh@joeyh.name>
Wed, 18 May 2022 20:41:41 +0000 (16:41 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 18 May 2022 20:45:20 +0000 (16:45 -0400)
commit1cacfd1b199b1a9a093716e04afd7e5ef4bd26a5
tree8b35135ac0a46ac2bb46a244970eda64245cdcfd
parentebb76f0486030e1e6bae43b5f05d00d63a968681
avoid setEnv in test framework when tasty is running

setEnv is not thread safe and could cause a getEnv by another thread to
segfault, or perhaps other had behavior. This is particularly a problem
when using tasty, because tasty runs the test in a thread, and a getEnv
in another thread.

The use of top-level TMVars is ugly, but ok because only 1 test actually
runs at a time per process. Because it has to chdir into the test repo.

The setEnv that remains happens before tasty is running.

Sponsored-by: Dartmouth College's Datalad project
Test/Framework.hs
doc/todo/test_suite_unsafe_use_of_setEnv.mdwn