If you run the test in isolation and it works, while running this test in non-isolation (with other tests) and it fails, then "something" is happening to the state of your test program and that need to be fixed.
For instance,
- a memory leak in other tests that affects this one,
- the fact that you started too many threads without waiting for their completion (like what I am seeing in your snippet),
- etc.
This is not exactly a Boost.Test issue, Boost.Test just shows you that there is an (rather big) issue somewhere in the program. The way to nail down is to run things in isolation, possibly many times such that, for instance, you can really observe the increased need for memory or even a crash. Boost.Test tries hard to mitigate those crashes (intercepts operating systems' signals) and depending on the operating system shows memory leaks, but it is not magic.
Other way of isolating the issue would be to use other programs such as valgind
or asan
/tsan
.
One last possibility is that "script.sh"
is eating up all the memory of your operating system.