Closed vladak closed 11 months ago
The test is kind of special: it patches the Pool.map()
function to be a no-op and then calls do_sync()
with worker count of 42 and empty command set. The Pool.map()
is called with a context manager, so that when it is being closed, the terminate()
will be called for the workers and this is where it fails on Windows.
Instead of patching map()
, it would probably make better sense just to spy on it and give the pool some legitimate commands to process.
Also, if the commands
parameter of do_sync()
is empty, the function should just return. Maybe this is what is leading to the failure.
Looking at the do_sync()
code, the check_config
parameter should be better explained in the do_sync()
code - the configuration check is being done in CommandSequence
initialization. If there is any problem with the configuration, CommandConfigurationException
will be raised so if the init function returns to do_sync()
, then the configuration check must have passed.
The
test_dosync_check_config_empty
test sometimes fails on Windows due toPermissionError
when the pool processes are being terminated: