mutmut icon indicating copy to clipboard operation
mutmut copied to clipboard

Timeout Mechanism Not Working

Open aetherealtech opened this issue 2 years ago • 2 comments

I'm running mutmut 2.4.3 pyhd8ed1ab_0 on Windows. Mutations that lead to infinite loops are freezing the run, seemingly indefinitely (certainly more than 10x the original test run time).

I know it is an infinite loop because I can see the edit being made to one of the source files while the stuck mutation is being tested, and I can avoid it by whitelisting the relevant lines with # pragma: no mutate.

The code is looping over an iterator:

iterator = iter(...)

while True:
  value = next(iterator, None)
  if value is None:
    break

The mutation changes the break to continue. As I understand it, the resulting infinite loop is supposed to trigger a timeout when the test runs more than 10x as long as the original unmutated test run. However that is not happening. As far as I can tell no timeout is triggering at all even after waiting 10 minutes (the original test run takes less a fraction of a second). I have to manually terminate the test run.

aetherealtech avatar Aug 06 '23 13:08 aetherealtech

There are some reports of similar issues yea. Maybe that it's on windows is a clue. If you manage to track it down I would welcome a PR.

boxed avatar Aug 06 '23 18:08 boxed

Can confirm. The test test_popen_streaming_output_timeout is failing on windows as well:

>       assert (time() - start) < 3
E       assert (1712241113.920155 - 1712241109.8610828) < 3
E        +  where 1712241113.920155 = time()

Maybe that narrows it down further?

FlTr avatar Apr 04 '24 14:04 FlTr