[issue46709] test_urllib: testInterruptCaught() has a race condition and fails randomly

Nikita Sobolev report at bugs.python.org
Fri Feb 11 02:43:20 EST 2022


Nikita Sobolev <mail at sobolevn.me> added the comment:

I am trying to debug this.

Several intersting notes:
1. `time.sleep()` does not help
2. It always fails on `8`th turn
3. Changing `self.assertTrue(result.shouldStop)` to

```
msg = f'{type(result)} {vars(result)}'
self.assertTrue(result.shouldStop, msg)
```

fixes the problem.

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46709>
_______________________________________


More information about the Python-bugs-list mailing list