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
test_urllib2_localnet fails #61764
Comments
The test_urllib2_localnet test fails when run with a clean build from a clean checkout. Machine: Test output: $ ./python -m test -v test_urllib2_localnet
== CPython 3.4.0a0 (default:53cc3dbb1918, Mar 27 2013, 21:05:11) [GCC 4.6.3]
== Linux-3.2.0-29-generic-x86_64-with-debian-wheezy-sid little-endian
== /home/mark/repositories/cpython/build/test_python_4588
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
[1/1] test_urllib2_localnet
test_proxy_qop_auth_int_works_or_throws_urlerror (test.test_urllib2_localnet.ProxyAuthTests) ... ok
test_proxy_qop_auth_works (test.test_urllib2_localnet.ProxyAuthTests) ... ok
test_proxy_with_bad_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests) ... ok
test_proxy_with_no_password_raises_httperror (test.test_urllib2_localnet.ProxyAuthTests) ... ok
test_200 (test.test_urllib2_localnet.TestUrlopen) ... ok
test_200_with_parameters (test.test_urllib2_localnet.TestUrlopen) ... ok
test_404 (test.test_urllib2_localnet.TestUrlopen) ... ok
test_bad_address (test.test_urllib2_localnet.TestUrlopen) ... FAIL
test_basic (test.test_urllib2_localnet.TestUrlopen) ... ok
test_chunked (test.test_urllib2_localnet.TestUrlopen) ... ok
test_geturl (test.test_urllib2_localnet.TestUrlopen) ... ok
test_https (test.test_urllib2_localnet.TestUrlopen) ... stopping HTTPS server
joining HTTPS thread
ok
test_https_sni (test.test_urllib2_localnet.TestUrlopen) ... stopping HTTPS server
joining HTTPS thread
ok
test_https_with_cadefault (test.test_urllib2_localnet.TestUrlopen) ... stopping HTTPS server
Got an error:
[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:555)
joining HTTPS thread
ok
test_https_with_cafile (test.test_urllib2_localnet.TestUrlopen) ... Got an error:
[SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:555)
stopping HTTPS server
joining HTTPS thread
stopping HTTPS server
joining HTTPS thread
ok
test_info (test.test_urllib2_localnet.TestUrlopen) ... ok
test_iteration (test.test_urllib2_localnet.TestUrlopen) ... ok
test_line_iteration (test.test_urllib2_localnet.TestUrlopen) ... ok
test_redirection (test.test_urllib2_localnet.TestUrlopen) ... ok
test_sending_headers (test.test_urllib2_localnet.TestUrlopen) ... ok ====================================================================== Traceback (most recent call last):
File "/home/mark/repositories/cpython/Lib/test/test_urllib2_localnet.py", line 568, in test_bad_address
"http://sadflkjsasf.i.nvali.d./")
AssertionError: OSError not raised by urlopen Ran 20 tests in 1.080s FAILED (failures=1) |
Are you behind some kind of a proxy? This is seen when you are running the tests and your interent connection is via proxy (and that is handling this invalid URL test) |
There's a comment in the test that says it might be because of the ISP. |
Indeed, this is almost always a (common) ISP DNS server misconfiguration. Well, they would claim they are "helping their users", but we know better. Not much we can do about it, except perhaps add an explanatory note to the test failure message (if assertRaises allows that...I think I requested that feature but I don't know if it has been added). |
Bah, stupid BT :( Perhaps we should just remove this test? |
I think we should instead have it email the ISP that their DNS is broken :) Seriously, though, complain to your ISP. My ISP at least provides name servers that don't have this "feature" if you prefer to use them, and they are the default for business accounts. So they are being stupid, but less stupid than the original offender. If you run a local DNS forwarding server, you can configure it to ignore the wildcard records from your upstream. IMO everyone should run a local DNS caching/forwarding server for both this reason and for performance :) If that test is run by default, we could change it to only run with -uall. Then normal users wouldn't see it. Now, all that said, I won't be crushed if the test gets deleted, but I will be very very sad about what that event says about modern ISPs. |
RDM's comment: If that test is run by default, we could change it to only run with -uall. Then normal users wouldn't see it. This is a good idea, only to reduce the occurrence of this test_run. Logically, this may not help at all. I am kind of undecided on this. Shall we take a call that the next bug report on the same issue, will lead to moving this test under network cover ? :) |
Moving it behind -uall/-unetwork sounds good to me. |
Attached a patch to skip the test unless -unetwork/-uall is provided. |
LGTM - please make the changes in all versions of python. ( I had the same patch pending locally and was waiting for my push->merge cycle time) |
New changeset f668d2267303 by Ezio Melotti in branch '3.3': New changeset a472fece6f31 by Ezio Melotti in branch '2.7': |
New changeset ae5c4a9118b8 by Ezio Melotti in branch 'default': |
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: