diff --git a/doc/bugs/v8_conflict_resolution___40__adjusted_branch__41___teststuck/comment_1_d530fb679b76e995c466fe17c3aab830._comment b/doc/bugs/v8_conflict_resolution___40__adjusted_branch__41___teststuck/comment_1_d530fb679b76e995c466fe17c3aab830._comment new file mode 100644 index 0000000000..0f51814161 --- /dev/null +++ b/doc/bugs/v8_conflict_resolution___40__adjusted_branch__41___teststuck/comment_1_d530fb679b76e995c466fe17c3aab830._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2022-05-18T18:05:04Z" + content=""" +That test case only runs a few simple git-annex commands, there is not anything +that takes a long time or that can loop. + +One possibility is that [[todo/test_suite_unsafe_use_of_setEnv]] could have +led to some undefined behavior that caused it to hang. +"""]] diff --git a/doc/todo/test_suite_unsafe_use_of_setEnv.mdwn b/doc/todo/test_suite_unsafe_use_of_setEnv.mdwn new file mode 100644 index 0000000000..3d95a9e99b --- /dev/null +++ b/doc/todo/test_suite_unsafe_use_of_setEnv.mdwn @@ -0,0 +1,20 @@ +The test suite uses setEnv in several places. (No other part of git-annex +does, basically.) However, setEnv is not thread safe, if another thread +runs getEnv at the same time it can crash. Or another setEnv, probably. + +This actually does segfault the test suite runners from time to time. +The test suite currently notices if there was a segfault and re-runs it. +While that works well enough, it's always possible there could be some +other behavior than just a segfault. + +See for a test case and +some analysis. See also . +Tasty uses getEnv, and that can apparently run while a test case is using setEnv. + +The main places that setEnv is used are in setTestMode. Fixing it will mean +plumbing a value all through the test suite. Or perhaps, using a single +toplevel MVar would be ok, since tests don't run concurrently? + +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.