sixty-north / cosmic-ray

Mutation testing for Python
MIT License
556 stars 54 forks source link

`await` on empty set when session is completely executed #516

Closed abingham closed 3 years ago

abingham commented 3 years ago

This is based on issues initially reported in #515.

If you initialize and fully execute a session, subsequent attempts to execute the session (an operation which is allowed and supported) result in an exception:

$ cosmic-ray init config.toml session.sqlite
$ cosmic-ray exec config.toml session.sqlite
$ cosmic-ray exec config.toml session.sqlite
...
File "/Users/abingham/repos/sixty-north/cosmic-ray/src/cosmic_ray/distribution/http.py", line 87, in _process
    done, pending = await asyncio.wait(fetchers.keys(), return_when=asyncio.ALL_COMPLETED)
  File "/Users/abingham/.pyenv/versions/3.9.1/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py", line 392, in wait
    raise ValueError('Set of coroutines/Futures is empty.')
ValueError: Set of coroutines/Futures is empty.
$

This has nothing to do with Windows as I initially suspected. It's just some bad logic/assumption in the execution routines.