Hi Henry
I worked it out in the end. The program being tested creates lots of temporary files. It tries to delete them, but on Windows sometimes it can't, because it or another process has them open. As a result, I kept on running out of disk space, and had countless thousands of files in my temporary directory (which took forever to delete.) So I added some code which runs at start-up, which scans the java.io.tmpdir for old files and deletes them all. It knows what files it should delete due to the particular naming conventions I used for temporary files. And that problem was solved. (The code is really only needed on Windows, but runs on all platforms anyway.)
But what happens next: I had tests in my test suite which tested this functionality. And I was blindly pitesting my entire test suite. So, pitest gets to these "delete old temp file" tests, and starts to mutate my old file deletion code. And it mutates it, from deleting only files in java.io.tmpdir which meet my naming conventions, to deleting all files in java.io.tmpdir - it mutated the "should this file be deleted?" test to always true. And then it goes ahead and deletes the temp files that pitest itself needs (the agent JAR.) Now, at the same time, pitest is in process of starting a slave. It goes to start the slave, and the slave JVM can't find the agent JAR, and exits. And then it hits the bug in pitest I mentioned, where it hangs if the slave JVM startup fails.
So, what I need to do to fix this as far as I am concerned: exclude the temp file cleanup tests from being tested with pitest, and/or tell pitest not to mutate the classes/methods involved in temp file cleanup. Moral of the story: be careful about mutation testing any code which does dangerous things like delete files. Who knows what the mutated code will end up deleting! I'm lucky it wasn't mutated into deleting something more important.
(Maybe it would make sense for pitest to run the code under a security manager, to prevent the mutated code from doing anything truly dangerous, like deleting files it should not be deleting? One could declare to the security manager "only allow modifications in these directories", and then if mutated code tried to go outside those bounds, it would be blocked....)
Simon