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
Improve test_os._kill (failing on slow machines) #52652
Comments
test_os._kill is used by test_kill_sigterm and test_kill_int and is failing on a slow Windows buildbot due to timing issues between the process starting and the signal being sent. I've checked in a few small time.sleep hacks in the meantime to see if that would help the bot, but I'd like to get a solid fix in there. The attached patch adds a loop to the test function to see that even if the subprocess doesn't respond right away, it will have a few chances to respond and run the test. If the expected message isn't piped from the subprocess after 5 retries, the test fails. |
I like this version of the patch better. Is there any reason not to drop the initial sleep(0.5) and loop 10 times instead? Any place we can cut down the sleeps so the test suite runs faster on fast machines is good. As someone else said, it *ought* to be possible to do this without ctypes. I'll see if I can find some time to play a few subprocess games on my windows KVM instance. |
With the patch, the test have 1.0 second to succeed. I would prefer 5.0 or 10.0 seconds: it should not waste the 10 seconds because it should succeed if a new milliseconds. But if the machine is "slow" (which is the topic of the issue), you can give some more seconds to the test. So max=100, sleep=0.1 |
I just noticed the other day that a buildbot failed because of this issue. Attached is a patch which removes the unconditional 0.5 sleep, and increases the loop to run 100 times. It should cover the worst case of a super slow buildbot, but is still typically complete in tenths of a second in the common case. |
Committed to trunk in r81584 and py3k in r81585. |
"sparc solaris10 gcc trunk" buildbot slave doesn't compile anymore. I'm not sure that it's related, so I prefer to not reopen the issue :-) http://www.python.org/dev/buildbot/trunk/builders/sparc%20solaris10%20gcc%20trunk/builds/891 ----------- |
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: