classification
Title: test_urllib2net.test_http_basic() timeout after 15 min on
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: florin.papa, martin.panter, vstinner, zach.ware
Priority: normal Keywords:

Created on 2016-04-14 14:53 by vstinner, last changed 2017-06-28 01:08 by vstinner. This issue is now closed.

Messages (5)
msg263411 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-04-14 14:53
Timeout seen on "x86-64 Ubuntu 15.10 Skylake CPU 3.5" buildbot:

http://buildbot.python.org/all/builders/x86-64%20Ubuntu%2015.10%20Skylake%20CPU%203.5/builds/357/steps/test/logs/stdio

[215/398] test_urllib2net
Timeout (0:15:00)!
Thread 0x00007f71354be700 (most recent call first):
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/socket.py", line 575 in readinto
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/http/client.py", line 258 in _read_status
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/http/client.py", line 297 in begin
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/http/client.py", line 1197 in getresponse
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py", line 1246 in do_open
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py", line 1271 in http_open
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py", line 443 in _call_chain
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py", line 483 in _open
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py", line 465 in open
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/urllib/request.py", line 162 in urlopen
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_urllib2net.py", line 19 in _retry_thrice
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_urllib2net.py", line 27 in wrapped
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/test_urllib2net.py", line 255 in test_http_basic
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/case.py", line 600 in run
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/case.py", line 648 in __call__
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py", line 122 in run
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/unittest/runner.py", line 176 in run
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/support/__init__.py", line 1800 in _run_suite
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/support/__init__.py", line 1834 in run_unittest
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", line 1305 in test_runner
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", line 1306 in runtest_inner
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", line 991 in runtest
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", line 784 in main
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/regrtest.py", line 1592 in main_in_temp_cwd
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/test/__main__.py", line 3 in <module>
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/runpy.py", line 85 in _run_code
  File "/home/buildbot/buildarea/3.5.intel-ubuntu-skylake/build/Lib/runpy.py", line 184 in _run_module_as_main
msg263412 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-04-14 14:55
See also issue #21069 "test_fileno of test_urllibnet intermittently fails".
msg263413 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-04-14 14:57
It looks deliberate to test the HTTP query with *no* timeout. Sadly, it looks like it's ok that an HTTP query takes longer than 15 minutes!

Can't we mock the query to only test that the socket timeout is None? Move the test from test_urllib2net to test_urllib2.

class TimeoutTest(unittest.TestCase):
    def test_http_basic(self):
        self.assertIsNone(socket.getdefaulttimeout())
        url = "http://www.example.com"
        with support.transient_internet(url, timeout=None):
            u = _urlopen_with_retry(url)
            self.addCleanup(u.close)
            self.assertIsNone(u.fp.raw._sock.gettimeout())
msg263448 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-04-15 05:06
By “mock the query”, do you mean swap out the socket for a pretend socket object? Another option would be to connect to a server on localhost running on the background, like I did for the fileno() problem.

Looks like this test_http_basic() was intended to verify that no timeout was being used by default.
msg297102 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-28 01:08
Buildbot failure not seen last months, so I just close the issue.
History
Date User Action Args
2017-06-28 01:08:07vstinnersetstatus: open -> closed
resolution: out of date
messages: + msg297102

stage: resolved
2016-04-15 05:06:02martin.pantersetmessages: + msg263448
2016-04-14 14:58:36zach.waresetnosy: + zach.ware, florin.papa
2016-04-14 14:57:01vstinnersetmessages: + msg263413
2016-04-14 14:55:13vstinnersetmessages: + msg263412
2016-04-14 14:53:12vstinnercreate