Ah, I see. There may be a misunderstanding here. According to the comment you removed, the datadir should actually be “unique”, not “deterministic”. (“Random context to get unique temp data dirs.”)
Aha, time to bring out the git log -S "Random context to get unique temp data dirs"
command. ;)
I see it was your fae43a97ca947cd0802392e9bb86d9d0572c0fba from 2019, so it’s hard to argue that the author may have meant “unique” as in simply different from other tests. :) See you introduced the later seeding of the RNG in that commit too.
On the other hand, you (together with me) ACKed #29625 which contains 97e16f57042cab07e5e73f6bed19feec2006e4f7, moving the seeding prior to directory naming randomization. Do you now disagree with it?
Once you make it deterministic, there will be a chance of collision, which may lead to a crash, which this pull request is trying to fix, no?
The PR does fix collisions between different tests that would otherwise happen when RANDOM_CTX_SEED
was set to the same value, which was resulting in the same folder name being used. (RANDOM_CTX_SEED=21 make -j10 check
).
I don’t think anything here is a common case. So in theory an alternative “fix” would be to simply say in a comment that RANDOM_CTX_SEED can only be used when running a single test process at a time.
Combining tests with setting RANDOM_CTX_SEED
is indeed an edge case. This PR arguably implements missing test names for bench+fuzz, missing support for forwarding RANDOM_CTX_SEED
to fuzz tests, simplifies the code through removing g_rng_temp_path
which had a no longer valid comment after 97e16f57042cab07e5e73f6bed19feec2006e4f7, the main fix/complexity lies in adding entropy to the random folder path using the test name.
The extremely paranoid would say that the folder name generation could influence test success/failure, so having it deterministic is helpful. Unit tests are poorly written if that is ever the case, but for fuzzing it’s still an open question to me.