You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_urllib fail in s390x buildbots: http://www.example.com/ #80200
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 89, in test_close
response = _urlopen_with_retry(url)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 27, in wrappedreturn _retry_thrice(func, exc, *args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 23, in _retry_thriceraise last_exc
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 19, in _retry_thricereturn func(*args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 222, in urlopenreturn opener.open(url, data, timeout)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 531, in open
response = meth(req, response)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 641, in http_response'http', request, response, code, msg, hdrs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 569, in errorreturnself._call_chain(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 649, in http_error_defaultraise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 181, in test_custom_headers
opener.open(request)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 531, in open
response = meth(req, response)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 641, in http_response'http', request, response, code, msg, hdrs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 569, in errorreturnself._call_chain(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 649, in http_error_defaultraise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 264, in test_http_basic
u = _urlopen_with_retry(url)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 27, in wrappedreturn _retry_thrice(func, exc, *args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 23, in _retry_thriceraise last_exc
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 19, in _retry_thricereturn func(*args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 222, in urlopenreturn opener.open(url, data, timeout)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 531, in open
response = meth(req, response)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 641, in http_response'http', request, response, code, msg, hdrs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 569, in errorreturnself._call_chain(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 649, in http_error_defaultraise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 274, in test_http_default_timeout
u = _urlopen_with_retry(url)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 27, in wrappedreturn _retry_thrice(func, exc, *args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 23, in _retry_thriceraise last_exc
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 19, in _retry_thricereturn func(*args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 222, in urlopenreturn opener.open(url, data, timeout)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 531, in open
response = meth(req, response)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 641, in http_response'http', request, response, code, msg, hdrs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 569, in errorreturnself._call_chain(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 649, in http_error_defaultraise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 286, in test_http_no_timeout
u = _urlopen_with_retry(url, timeout=None)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 27, in wrappedreturn _retry_thrice(func, exc, *args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 23, in _retry_thriceraise last_exc
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 19, in _retry_thricereturn func(*args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 222, in urlopenreturn opener.open(url, data, timeout)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 531, in open
response = meth(req, response)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 641, in http_response'http', request, response, code, msg, hdrs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 569, in errorreturnself._call_chain(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 649, in http_error_defaultraise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/support/__init__.py:1539: ResourceWarning: unclosed <socket.socket [closed] fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/support/__init__.py:1539: ResourceWarning: unclosed <socket.socket [closed] fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/support/__init__.py:1539: ResourceWarning: unclosed <socket.socket [closed] fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/support/__init__.py:1539: ResourceWarning: unclosed <socket.socket [closed] fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
test test_urllib2net failed
Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 295, in test_http_timeout
u = _urlopen_with_retry(url, timeout=120)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 27, in wrappedreturn _retry_thrice(func, exc, *args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 23, in _retry_thriceraise last_exc
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/test/test_urllib2net.py", line 19, in _retry_thricereturn func(*args, **kwargs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 222, in urlopenreturn opener.open(url, data, timeout)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 531, in open
response = meth(req, response)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 641, in http_response'http', request, response, code, msg, hdrs)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 569, in errorreturnself._call_chain(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/home/dje/cpython-buildarea/3.7.edelsohn-rhel-z/build/Lib/urllib/request.py", line 649, in http_error_defaultraise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Ran 15 tests in 1.006s
FAILED (errors=6, skipped=1)
3 tests failed again:
test_urllib2 test_urllib2net test_urllibnet
Use a public server or pythontest.net server (it's a public server on the Internet). could we the http requests? I use this practice for the unit test with an external web service, but for the integration tests, I prefer to use the real web service.
Here is the list of the external resources that we use in the tests.
test_issue16464 (test.test_urllib2.MiscTests) ... skipped "Resource 'http://www.example.com/' is not available"
test_close (test.test_urllib2net.CloseSocketTest) ... skipped "Resource 'http://www.example.com/' is not available"
test_custom_headers (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.example.com' is not available"
test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ... skipped 'XXX: http://www.imdb.com is gone'
test_http_basic (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
test_http_default_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
test_http_no_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
test_http_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
in the failed tests:
test_urllib2 test_urllib2net test_urllibnet
@vstinner I have fixed some URLs but we need to update pythontest.net for some tests.
For example: test.test_urllib2.MiscTests.test_issue16464 raises a HTTP 405 and pythontest.net does not support the requested method.
test_networked_trusted_by_default_cert (test.test_httplib.HTTPSTest) ... skipped "Resource 'www.python.org' is not available"
test_logincapa (test.test_imaplib.RemoteIMAPTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logout (test.test_imaplib.RemoteIMAPTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logincapa (test.test_imaplib.RemoteIMAP_SSLTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logout (test.test_imaplib.RemoteIMAP_SSLTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logincapa (test.test_imaplib.RemoteIMAP_STARTTLSTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logout (test.test_imaplib.RemoteIMAP_STARTTLSTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
skipped "Resource 'news.trigofacile.com' is not available"
skipped "Resource 'nntp.aioe.org' is not available"
test_connect (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_default_port (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_using_sslcontext (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_using_sslcontext_verified (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_starttls (test.test_smtpnet.SmtpTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_get_server_certificate_ipv6 (test.test_ssl.NetworkedTests) ... skipped "Resource 'ipv6.google.com' is not available"
test_idna (test.test_socket.GeneralModuleTests) ... skipped "Resource 'python.org' is not available"
testAcceptTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testConnectTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testRecvTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testSend (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testSendall (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testSendto (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
test_issue16464 (test.test_urllib2.MiscTests) ... skipped "Resource 'http://www.example.com/' is not available"
----------------------------------------------------------------------
Ran 56 tests in 25.105s
OK (skipped=1)
Re-running test 'test_normalization' in verbose mode
test_bug_834676 (test.test_normalization.NormalizationTest) ... ok
test test_normalization failed
test_main (test.test_normalization.NormalizationTest) ... fetching http://www.pythontest.net/unicode/11.0.0/NormalizationTest.txt ...
FAIL
======================================================================
FAIL: test_main (test.test_normalization.NormalizationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/urllib/request.py", line 1316, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
socket.gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_normalization.py", line 41, in test_main
testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_normalization.py", line 47, in test_mainself.fail(f"Could not retrieve {TESTDATAURL}")
AssertionError: Could not retrieve http://www.pythontest.net/unicode/11.0.0/NormalizationTest.txt
Ran 2 tests in 20.044s
FAILED (failures=1)
Re-running test 'test_urllib2net' in verbose mode
test_close (test.test_urllib2net.CloseSocketTest) ... skipped "Resource 'http://www.example.com/' is not available"
test_custom_headers (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.example.com' is not available"
test_file (test.test_urllib2net.OtherNetworkTests) ... ok
test_ftp (test.test_urllib2net.OtherNetworkTests) ... ok
test_redirect_url_withfrag (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.pythontest.net/redir/with_frag/' is not available"
test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ... skipped 'XXX: http://www.imdb.com is gone'
test_urlwithfrag (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.pythontest.net/index.html#frag' is not available"
test_ftp_basic (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_basic (test.test_urllib2net.TimeoutTest) ... ok
test_http_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/init.py:1608: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('45.56.109.169', 46650), raddr=('104.236.16.9', 21)>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/init.py:1608: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('45.56.109.169', 46662), raddr=('104.236.16.9', 21)>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
test_http_timeout (test.test_urllib2net.TimeoutTest) ... ok
----------------------------------------------------------------------
Ran 15 tests in 686.335s
OK (skipped=5)
1 test failed again:
test_normalization
New changeset a40681d by Victor Stinner (Stéphane Wirtel) in branch 'master': bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941) a40681d
New changeset a40681d by Victor Stinner (Stéphane Wirtel) in branch 'master':
bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)
I'm not sure that this change will fix https://bugs.python.org/issue36019 but I prefer that your CI doesn't flood public servers like google.com or example.com. I prefer that we control the external resources used by our tests.
New changeset 6163210 by Miss Islington (bot) in branch '3.7': bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941) 6163210
New changeset 84772e0 by Victor Stinner (Stéphane Wirtel) in branch '2.7':
[2.7] bpo-36019: Use pythontest.net in urllib network tests (GH-11941) (GH-12177) 84772e0
Stéphane Wirtel backported his fix to Python 2.7. I didn't see failures related to example.com on 3.7 and master branches, so I think that it's now time to close the issue.
test.test_urllib2.MiscTests.test_issue16464 started to fail again:
======================================================================
ERROR: test_issue16464 (test.test_urllib2.MiscTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/runner/work/cpython/cpython/Lib/test/support/socket_helper.py", line 245, in transient_internet
yield
^^^^^
File "/Users/runner/work/cpython/cpython/Lib/test/test_urllib2.py", line 1799, in test_issue16464
opener.open(request, "1".encode("us-ascii"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/runner/work/cpython/cpython/Lib/urllib/request.py", line 525, in open
response = meth(req, response)
^^^^^^^^^^^^^^^^^^^
File "/Users/runner/work/cpython/cpython/Lib/urllib/request.py", line 634, in http_response
response = self.parent.error(
^^^^^^^^^^^^^^^^^^
File "/Users/runner/work/cpython/cpython/Lib/urllib/request.py", line 563, in error
return self._call_chain(*args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/runner/work/cpython/cpython/Lib/urllib/request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "/Users/runner/work/cpython/cpython/Lib/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib.error.HTTPError: HTTP Error 404: Not Found
----------------------------------------------------------------------
Ran 1 test in 0.093s
Activity
pablogsal commentedon Feb 18, 2019
test_urllib fail in s390x buildbots. It does not seem like a temporary failure as they keep failing consistently. Some failed builds:
https://buildbot.python.org/all/#builders/126/builds/1010
https://buildbot.python.org/all/#builders/122/builds/1026
https://buildbot.python.org/all/#builders/119/builds/1060
https://buildbot.python.org/all/#builders/21/builds/2332
======================================================================
ERROR: test_close (test.test_urllib2net.CloseSocketTest)
----------------------------------------------------------------------
======================================================================
ERROR: test_custom_headers (test.test_urllib2net.OtherNetworkTests)
----------------------------------------------------------------------
======================================================================
ERROR: test_http_basic (test.test_urllib2net.TimeoutTest)
----------------------------------------------------------------------
======================================================================
ERROR: test_http_default_timeout (test.test_urllib2net.TimeoutTest)
----------------------------------------------------------------------
======================================================================
ERROR: test_http_no_timeout (test.test_urllib2net.TimeoutTest)
----------------------------------------------------------------------
======================================================================
ERROR: test_http_timeout (test.test_urllib2net.TimeoutTest)
----------------------------------------------------------------------
Ran 15 tests in 1.006s
FAILED (errors=6, skipped=1)
3 tests failed again:
test_urllib2 test_urllib2net test_urllibnet
vstinner commentedon Feb 18, 2019
These random network failure occur with http://www.example.com/:
#10608 (comment)
I don't think that it's a good idea to use a public server for our tests. I would be better to use pythontest.net instead.
[-]test_urllib fail in s390x buildbots[/-][+]test_urllib fail in s390x buildbots: http://www.example.com/[/+]matrixise commentedon Feb 18, 2019
Use a public server or pythontest.net server (it's a public server on the Internet). could we the http requests? I use this practice for the unit test with an external web service, but for the integration tests, I prefer to use the real web service.
matrixise commentedon Feb 18, 2019
sorry, error with my copy/paste/fixing_words: but my sentence was "could we mock the http requests?"
vstinner commentedon Feb 18, 2019
No, the tests are functional tests which use deliberate HTTP request to public servers.
I suggest to use a server that we control rather multiple "third-party" servers. I'm trying to keep a list of external services used by Python test suite:
https://pythondev.readthedocs.io/infra.html#services-used-by-unit-tests
matrixise commentedon Feb 19, 2019
ok for me if you prefer to use a function test with pythontest.net
matrixise commentedon Feb 19, 2019
Here is the list of the external resources that we use in the tests.
test_issue16464 (test.test_urllib2.MiscTests) ... skipped "Resource 'http://www.example.com/' is not available"
test_close (test.test_urllib2net.CloseSocketTest) ... skipped "Resource 'http://www.example.com/' is not available"
test_custom_headers (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.example.com' is not available"
test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ... skipped 'XXX: http://www.imdb.com is gone'
test_http_basic (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
test_http_default_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
test_http_no_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
test_http_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 'http://www.example.com' is not available"
in the failed tests:
test_urllib2 test_urllib2net test_urllibnet
matrixise commentedon Feb 19, 2019
@vstinner and @pablogsal
I started to work on this issue, the PR is in WIP mode.
matrixise commentedon Feb 19, 2019
@vstinner I have fixed some URLs but we need to update pythontest.net for some tests.
For example: test.test_urllib2.MiscTests.test_issue16464 raises a HTTP 405 and pythontest.net does not support the requested method.
test_networked_trusted_by_default_cert (test.test_httplib.HTTPSTest) ... skipped "Resource 'www.python.org' is not available"
test_logincapa (test.test_imaplib.RemoteIMAPTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logout (test.test_imaplib.RemoteIMAPTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logincapa (test.test_imaplib.RemoteIMAP_SSLTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logout (test.test_imaplib.RemoteIMAP_SSLTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logincapa (test.test_imaplib.RemoteIMAP_STARTTLSTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
test_logout (test.test_imaplib.RemoteIMAP_STARTTLSTest) ... skipped "Resource 'cyrus.andrew.cmu.edu' is not available"
skipped "Resource 'news.trigofacile.com' is not available"
skipped "Resource 'nntp.aioe.org' is not available"
test_connect (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_default_port (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_using_sslcontext (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_using_sslcontext_verified (test.test_smtpnet.SmtpSSLTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_connect_starttls (test.test_smtpnet.SmtpTest) ... skipped "Resource 'smtp.gmail.com' is not available"
test_get_server_certificate_ipv6 (test.test_ssl.NetworkedTests) ... skipped "Resource 'ipv6.google.com' is not available"
test_idna (test.test_socket.GeneralModuleTests) ... skipped "Resource 'python.org' is not available"
testAcceptTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testConnectTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testRecvTimeout (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testSend (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testSendall (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
testSendto (test.test_timeout.TCPTimeoutTestCase) ... skipped "Resource 'www.python.org.' is not available"
test_issue16464 (test.test_urllib2.MiscTests) ... skipped "Resource 'http://www.example.com/' is not available"
pablogsal commentedon Feb 21, 2019
Related failure:
https://buildbot.python.org/all/#/builders/141/builds/1233
----------------------------------------------------------------------
Ran 56 tests in 25.105s
OK (skipped=1)
Re-running test 'test_normalization' in verbose mode
test_bug_834676 (test.test_normalization.NormalizationTest) ... ok
test test_normalization failed
test_main (test.test_normalization.NormalizationTest) ... fetching http://www.pythontest.net/unicode/11.0.0/NormalizationTest.txt ...
FAIL
======================================================================
FAIL: test_main (test.test_normalization.NormalizationTest)
----------------------------------------------------------------------
Ran 2 tests in 20.044s
FAILED (failures=1)
Re-running test 'test_urllib2net' in verbose mode
test_close (test.test_urllib2net.CloseSocketTest) ... skipped "Resource 'http://www.example.com/' is not available"
test_custom_headers (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.example.com' is not available"
test_file (test.test_urllib2net.OtherNetworkTests) ... ok
test_ftp (test.test_urllib2net.OtherNetworkTests) ... ok
test_redirect_url_withfrag (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.pythontest.net/redir/with_frag/' is not available"
test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ... skipped 'XXX: http://www.imdb.com is gone'
test_urlwithfrag (test.test_urllib2net.OtherNetworkTests) ... skipped "Resource 'http://www.pythontest.net/index.html#frag' is not available"
test_ftp_basic (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_ftp_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_basic (test.test_urllib2net.TimeoutTest) ... ok
test_http_default_timeout (test.test_urllib2net.TimeoutTest) ... ok
test_http_no_timeout (test.test_urllib2net.TimeoutTest) ... ok
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/init.py:1608: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('45.56.109.169', 46650), raddr=('104.236.16.9', 21)>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/support/init.py:1608: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('45.56.109.169', 46662), raddr=('104.236.16.9', 21)>
gc.collect()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
test_http_timeout (test.test_urllib2net.TimeoutTest) ... ok
----------------------------------------------------------------------
Ran 15 tests in 686.335s
OK (skipped=5)
1 test failed again:
test_normalization
Also, it seems that there are some socket leaks.
vstinner commentedon Feb 22, 2019
New changeset a40681d by Victor Stinner (Stéphane Wirtel) in branch 'master':
bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)
a40681d
vstinner commentedon Feb 22, 2019
I'm not sure that this change will fix https://bugs.python.org/issue36019 but I prefer that your CI doesn't flood public servers like google.com or example.com. I prefer that we control the external resources used by our tests.
miss-islington commentedon Feb 22, 2019
New changeset 6163210 by Miss Islington (bot) in branch '3.7':
bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)
6163210
vstinner commentedon Mar 4, 2019
Stéphane: Python 2.7 is also affected by the issue. Would you be interested in backport the fix to Lib/test/test_urllibnet.py? (in master, it's Lib/test/test_urllib2net.py).
https://buildbot.python.org/all/#/builders/68/builds/238
Re-running failed tests in verbose mode
Re-running test 'test_urllibnet' in verbose mode
ERROR: testURLread (test.test_urllibnet.URLTimeoutTest)
ERROR: test_basic (test.test_urllibnet.urlopenNetworkTests)
ERROR: test_geturl (test.test_urllibnet.urlopenNetworkTests)
ERROR: test_info (test.test_urllibnet.urlopenNetworkTests)
ERROR: test_readlines (test.test_urllibnet.urlopenNetworkTests)
ERROR: test_basic (test.test_urllibnet.urlretrieveNetworkTests)
matrixise commentedon Mar 4, 2019
sure, I will do the backport tomorrow. thanks for the notif
matrixise commentedon Mar 5, 2019
Hi Victor,
For the backport, should I add support.TEST_HTTP_URL?
matrixise commentedon Mar 5, 2019
Victor,
Should I also fix these tests:
test_urllibnet.py::urlretrieveNetworkTests.test_specified_path
test_urllibnet.py::urlretrieveNetworkTests.test_header
test_urllibnet.py::urlopenNetworkTests.test_fileno
?
vstinner commentedon Mar 5, 2019
Yes
Yes, all urllib and urllib2 tests which use http://www.example.com/
vstinner commentedon Mar 5, 2019
New changeset 84772e0 by Victor Stinner (Stéphane Wirtel) in branch '2.7':
[2.7] bpo-36019: Use pythontest.net in urllib network tests (GH-11941) (GH-12177)
84772e0
vstinner commentedon Mar 5, 2019
Stéphane Wirtel backported his fix to Python 2.7. I didn't see failures related to example.com on 3.7 and master branches, so I think that it's now time to close the issue.
Thanks Stéphane!
sobolevn commentedon Feb 5, 2022
test.test_urllib2.MiscTests.test_issue16464started to fail again:Link: https://github.com/python/cpython/runs/5077404591?check_suite_focus=true#step:7:705
Today I had like 3 or 4 different CI failures because of it.
sobolevn commentedon Feb 5, 2022
I can also reproduce it locally with:
./python.exe -m test -v test_urllib2 -m test_issue16464 -u networkI've opened a new issue for it: https://bugs.python.org/issue46648