New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intermittent failure of multiprocessing unit test test_imap_unordered_handle_iterable_exception #67901
Comments
test_imap_unordered_handle_iterable_exception fails intermittently on some platforms due to the test being too rigid (fragile) about the order of the items being iterated over which, as the name would imply, is not guaranteed. Of the multiprocessing module's test modules, test_multiprocessing_fork, test_multiprocessing_forkserver, and test_multiprocessing_spawn all leverage the unit test test_imap_unordered_handle_iterable_exception in multiple different contexts. There are thus multiple opportunities for test_imap_unordered_handle_iterable_exception to fail due to this fragility -- it's maybe a little bit surprising the test doesn't fail more often than it does. A patch is forthcoming. |
Attaching patch for this fragile test for 2.7 branch. Patches have been put through test.regrtest on OS X 10.10 (64-bit), FreeBSD 10.1 i386 (32-bit), and Raspbian Debian (ARMv6) thus far. |
Why not use just
or
? |
Serhiy: If I understand correctly what you suggest, calling sorted(it) or list(it) would run the iterator all the way until it raises the SayWhenError exception, triggering the self.assertRaises before it ever actually gets to call the self.assertEqual or self.assertCountEqual you suggest. It would indeed test the raising of the exception but would never test individual values returned by the iterator to see that they belong. Or were you suggesting something different? |
Just saw this on x86 Tiger 3.x: ====================================================================== Traceback (most recent call last):
File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 1805, in test_imap_unordered_handle_iterable_exception
self.assertEqual(next(it), i*i)
AssertionError: 1 != 0 http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/9559/steps/test/logs/stdio The patch looks good to me. I'm not familiar with the test code, but Serhiy's suggestion also looks good to me. |
Serhiy: If my comments on your questions make sense, should we go ahead with the patch as it is? |
Thanks for your explanation and sorry for the delay Davin. Yes, it makes sense. |
New changeset 0ac30526c208 by Serhiy Storchaka in branch '2.7': New changeset 0eb5968c15ad by Serhiy Storchaka in branch '3.4': New changeset f60f65507d8e by Serhiy Storchaka in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: