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
This commit is contained in:
Joey Hess 2022-05-18 16:41:41 -04:00
parent ebb76f0486
commit 1cacfd1b19
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 70 additions and 46 deletions

View file

@ -19,4 +19,4 @@ There is also Utility.Gpg.testHarness, which sets GNUPGHOME. It seems that
instead, every place that git-annex is run inside the gpg test harness
would need to add GNUPGHOME to the environment of the git-annex process.
> Fixed this part to not setEnv. --[[Joey]]
> [[fixed|done]] --[[Joey]]