-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Labels
Description
Mutmut 3 currently can be run on Windows through the WSL, but not natively on Windows.
We use fork() as a performance optimization, which only works on Unix systems. However, it should be possible to rewrite mutmut to also work with other multiprocessing options. This would be slower (as we cannot copy the whole memory at fork time, including the initialized pytest setup), but still a nice to have.
If someone wants to add native Windows support, we likely need to:
- rewrite the
_run()method to use a thespawnmethod instead ofos.fork() - pass all necessary arguments to this process (currently we rely on global + local variables to be copied via
forking the whole process memory)
While doing so, we want to ensure that (at least for Linux and MacOS) we have:
- same performance as before (at least for Linux and MacOS)
- same test error handling as before (not sure what/how we currently support this. But e.g. what happens a unit test calls
os._exit()?) - test timeout (currently we use
resource.RLIMIT_CPU, which is Unix-only if I'm not mistaken. This is necessary as mutants can easily create infinite loops)
I would consider following approaches, though there may be better ones:
- create a new process per mutant (as we do now)
- create
max_childrenworker processes and initialize pytest there. The worker processes keep polling mutation tasks from a Queue and perform them - use a
multiprocessing.pool.Poolof sizemax_childrenand initialize pytest in the setup
disouzam