We need to prefetch JSON and TOML grammars before running the tests, on pain of race condition:
If multiple calls to Topiary are made in parallel and the grammar is missing, they will all try to fetch and build it, thus creating an empty .so file while g++ is running.
If another instance of Topiary starts at this moment, it will mistake the empty .so file for an already built grammar, and try to run with it, resulting in an error.
Description
We need to prefetch JSON and TOML grammars before running the tests, on pain of race condition: If multiple calls to Topiary are made in parallel and the grammar is missing, they will all try to fetch and build it, thus creating an empty
.so
file whileg++
is running. If another instance of Topiary starts at this moment, it will mistake the empty.so
file for an already built grammar, and try to run with it, resulting in an error.Closes #767
Checklist
Checklist before merging: