I can set the value of the parameter forkCount
to any desired number, say 12, and I'd expect to have 12 new Java processes of type surefirebooter
when running tests like these. But ps
shows that I only sometimes get the 12 expected Java processes (to be precise: I get them extremely rarely). Instead I typically get less, sometimes even only three or four. Execution of my hundreds of unit tests also appears to be slow then.
The running processes also often disappear from the ps
output (terminate, I assume) before the unit tests are done. In some cases all of them, then the execution hangs indefinitely.
Documentation wasn't too clear about this, but I'd expect to have the given number of processes all the time until all unit tests are done.
Maybe the surefirebooter
processes run into some problem and terminate prematurely. I see no error message, though. Where should I see them? Can I switch on some debug logging? Switching on the debug mode of Surefire changed the test results, so I didn't follow that path very far.
I'm running ~1600 unit tests in ~400 classes which takes ~7 minutes in the best case. Execution time varies greatly, sometimes the whole thing terminates after more than an hour.
In some cases, on the other hand, the surefirebooter
processes continue to run after execution finished (successfully) and puts massive load on the system (so it seems to be busy waiting for something).
Questions:
- Can anybody explain these observed phenomena?
- Can anybody give advice what to change in order to have a more proper execution? (I. e. with the desired number of
surefirebooter
processes at all times.) - Can anybody give advice on how to debug the situation? See messages about what happens with the
surefirebooter
processes? (I tried usingstrace
but that also changed the behavior so dramatically that the call didn't terminate anymore.)
forkCount
is a maximum value, so it may be normal to have less sometimes (not sure), but the execution definitely shouldn't hang. Try to set<reuseForks>true</reuseForks>
, that will make sure forks are created only once and reused throughout the test. What value are you using forparallel
? – Innovate2.18.1
.reuseForks
: documented as beingtrue
on default. I will try out if I experience different results with it being explicitly set totrue
and report on the results here.parallel
is not used; our classes under test are not designed to work correctly when their unit tests are run in parallel on their instances. Tests enabling this feature also showed the expected (failing) behavior. – AcrilanreuseForks
to its documented defaulttrue
doesn't seem to have any influence from my trials. – Acrilan