[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

Brett Cannon report at bugs.python.org
Sat Sep 1 13:42:03 EDT 2018


Brett Cannon <brett at python.org> added the comment:

Maybe I'm missing something, but who is racing whom in this case? All the examples people have shared are simply running the test module directly which means there's no parallelism in the execution of the test runner with other tests. Does unittest.main() randomize the order and it's a sequence issue more than a concurrency issue?

For instance, Lorenz may have tracked this issue down to cleanup, but each of those test methods should have been run sequentially, meaning that the tearDown() method would have been called after every execution of a test with no concurrency going on.

And the temp modules for the tests are put in a directory created using tempfile.mkdtemp() so that should prevent test methods stomping on each other.

Perhaps we need to improve the failure messages at this point in the tests to get more clues as to the state of things when the failures occur?

----------

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


More information about the Python-bugs-list mailing list