bpo-38614: Add timeout constants to test.support#16964
bpo-38614: Add timeout constants to test.support#16964vstinner merged 1 commit intopython:masterfrom vstinner:support_timeout
Conversation
|
Somehow related, in 2014, I tried to make time.sleep() calls configurable in tests: https://bugs.python.org/issue20910 |
|
@pablogsal: Would you mind to review this PR? I'm not sure about the documentation of SHORT_TIMEOUT vs LONG_TIMEOUT. LONG_TIMEOUT is 10 times larger than SHORT_TIMEOUT. |
There was a problem hiding this comment.
Nit: should we add markup links to connect(), recv()...?
Basically `connect` -> :meth:`socket.socket.connect`
There was a problem hiding this comment.
Or perhaps :meth:~socket.socket.connect to avoid showing the fully-qualified name,
There was a problem hiding this comment.
Markup link to socket.socket?
There was a problem hiding this comment.
Perhaps not needed if the methods are linked.
There was a problem hiding this comment.
| Usually, a timeout using INTERNET_TIMEOUT should not mark a test a failed, | |
| Usually, a timeout using INTERNET_TIMEOUT should not mark a test as failed, |
There was a problem hiding this comment.
Suggestion: link to transient_internet if it makes sense.
There was a problem hiding this comment.
| slower. It is not designed to measure a function performance. | |
| It is not designed to measure a function performance. |
There was a problem hiding this comment.
| enough to reduce the risk of test failure on the slowest Python buildbot | |
| enough to reduce the risk of test failure on the slowest Python buildbot. |
There was a problem hiding this comment.
| # For slowest buildbot worker, increase SHORT_TIMEOUT and LONG_TIMEOUT | |
| # For a slow buildbot worker, increase SHORT_TIMEOUT and LONG_TIMEOUT |
There was a problem hiding this comment.
| # long enough to prevent test failure: it takes an account that the client and | |
| # long enough to prevent test failure: it takes into account that the client and |
There was a problem hiding this comment.
| prevent test failure: it takes an account that the client and the server can | |
| prevent test failure: it takes into account that the client and the server can |
There was a problem hiding this comment.
| # Usually, a timeout using INTERNET_TIMEOUT should not mark a test a failed, | |
| # Usually, a timeout using INTERNET_TIMEOUT should not mark a test as failed, |
Hummmm, maybe: |
There was a problem hiding this comment.
Or perhaps :meth:~socket.socket.connect to avoid showing the fully-qualified name,
There was a problem hiding this comment.
Perhaps not needed if the methods are linked.
There was a problem hiding this comment.
Why this special value rather than None, as in the other cases? Is it to support None as an actual timeout value?
There was a problem hiding this comment.
There is one test_socket test which requires timeout=None.
Add timeout constants to test.support: * LOOPBACK_TIMEOUT * INTERNET_TIMEOUT * SHORT_TIMEOUT * LONG_TIMEOUT
|
@pablogsal: I rephased the documentation to better distinguish SHORT and LONG timeout. Does it sound better to you? I took your review in account. I checked manually the HTML documentation to ensure that it's rendered properly ;-) I revert changes to use new timeouts, except test_socket and _test_multiprocessing to make this PR easier to review. I will write more PRs to use the new constants, I start to modify tons of tests, I prefer to have separated PRs to make them easier to review. |
Much better indeed! |
Add timeout constants to test.support: * LOOPBACK_TIMEOUT * INTERNET_TIMEOUT * SHORT_TIMEOUT * LONG_TIMEOUT
Add timeout constants to test.support: * LOOPBACK_TIMEOUT * INTERNET_TIMEOUT * SHORT_TIMEOUT * LONG_TIMEOUT
Add timeout constants to test.support:
https://bugs.python.org/issue38614