Repository navigation
bpo-30317: Fix multiprocessing test_timeout() - #8621
Conversation
Multiprocessing test_timeout() now accepts a delta of 100 ms instead of just 50 ms, since the test failed with 135.8 ms instead of the expected 200 ms.
|
Note: Python 2.7 doesn't have the test and so is not affected. |
|
@pablogsal: Would you mind to review my change? If it looks good to you, please merge it. Just don't forget to replace #xxx with GH-xxx in the commit message when you merge the change :-) Then you can wait for @miss-inlington to generate the backports, to approve the backports. If the bot fails to generate the backports, I will do it manually. |
|
Honestly, I'm not really happy to have to tolerate a delta of -100 ms on a wait of 200 ms, it's -50%! But I don't see what else can be done here. It's related to weak resolution of clocks on Windows, but I don't want to have a different clock resolution depending on the platform. |
| # bpo-30317: Tolerate a delta of 100 ms because of the bad clock | ||
| # resolution on Windows (usually 15.6 ms). x86 Windows7 3.x once | ||
| # failed because the delta was only 135.8 ms. | ||
| self.assertGreaterEqual(delta, 0.100) |
There was a problem hiding this comment.
Could we use the more permissive delta only when this test is being executed on Windows? It complicates the test a bit (two different values for the check) but it will not be permissive in all platforms, only in the ones with a bad clock resolution (Windows). What do you think?
I tried a generic more complex option in regrtest, but @pitrou didn't like the idea. If you want to do something, IMHO it should not only be done in one specific test, but be a parameter of regrtest. For this specfic change, I would prefer to just change the timeout. |
|
Oh. I succeeded to find my old issue to make "sleep configurable": https://bugs.python.org/issue20910 |
|
In short, I abandoned this approach and instead use the maximum timeout of all buildbots and put it in tests. It's not perfect, but it works :-) |
|
@vstinner I personally like the "configurable sleep" approach, but yeah, that certainly needs much more discussion /separate forum that this PR. Thank you for the link to https://bugs.python.org/issue20910! |
|
Thanks @vstinner for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
|
Sorry @vstinner and @pablogsal, I had trouble checking out the |
|
GH-8637 is a backport of this pull request to the 3.7 branch. |
Multiprocessing test_timeout() now accepts a delta of 100 ms instead of just 50 ms, since the test failed with 135.8 ms instead of the expected 200 ms. (cherry picked from commit 5640d03) Co-authored-by: Victor Stinner <vstinner@redhat.com>
Multiprocessing test_timeout() now accepts a delta of 100 ms instead of just 50 ms, since the test failed with 135.8 ms instead of the expected 200 ms. (cherry picked from commit 5640d03) Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
GH-8638 is a backport of this pull request to the 3.6 branch. |
Multiprocessing test_timeout() now accepts a delta of 100 ms instead of just 50 ms, since the test failed with 135.8 ms instead of the expected 200 ms. (cherry picked from commit 5640d03) Co-authored-by: Victor Stinner <vstinner@redhat.com>
Multiprocessing test_timeout() now accepts a delta of 100 ms instead of just 50 ms, since the test failed with 135.8 ms instead of the expected 200 ms. (cherry picked from commit 5640d03) Co-authored-by: Victor Stinner <vstinner@redhat.com>
Multiprocessing test_timeout() now accepts a delta of 100 ms instead
of just 50 ms, since the test failed with 135.8 ms instead of the
expected 200 ms.
https://bugs.python.org/issue30317