Skip to content
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

ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) #77476

Closed
methane opened this issue Apr 17, 2018 · 8 comments
Closed
Labels
3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@methane
Copy link
Member

methane commented Apr 17, 2018

BPO 33295
Nosy @orsenthil, @ned-deily, @methane, @berkerpeksag
PRs
  • bpo-33295: Skip test using missing external site #6504
  • [3.7] bpo-33295: Skip test using missing external site (GH-6504) #6509
  • [2.7] bpo-33295: Skip test using missing external site (GH-6504) #6510
  • [3.6] bpo-33295: Skip test using missing external site (GH-6504) #6511
  • 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:

    assignee = None
    closed_at = None
    created_at = <Date 2018-04-17.09:15:32.370>
    labels = ['3.7', '3.8', 'type-bug', 'tests']
    title = 'ERROR: test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests)'
    updated_at = <Date 2018-04-17.15:39:22.800>
    user = 'https://github.com/methane'

    bugs.python.org fields:

    activity = <Date 2018-04-17.15:39:22.800>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2018-04-17.09:15:32.370>
    creator = 'methane'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33295
    keywords = ['patch']
    message_count = 7.0
    messages = ['315384', '315399', '315400', '315401', '315402', '315403', '315404']
    nosy_count = 4.0
    nosy_names = ['orsenthil', 'ned.deily', 'methane', 'berker.peksag']
    pr_nums = ['6504', '6509', '6510', '6511']
    priority = 'critical'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue33295'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @methane
    Copy link
    Member Author

    methane commented Apr 17, 2018

    def test_sites_no_connection_close(self):
    # Some sites do not send Connection: close header.
    # Verify that those work properly. (#issue12576)
    URL = 'http://www.imdb.com' # mangles Connection:close
    with support.transient_internet(URL):
    try:
    with urllib.request.urlopen(URL) as res:
    pass
    except ValueError as e:
    self.fail("urlopen failed for site not sending \
    Connection:close")
    else:
    self.assertTrue(res)
    req = urllib.request.urlopen(URL)
    res = req.read()
    self.assertTrue(res)

    This test uses http://www.imdb.com/, but it is gone.
    So This test start failing.

    Is there any good URL for this test case?
    May I skip this test for now?

    @methane methane added 3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir labels Apr 17, 2018
    @ned-deily
    Copy link
    Member

    New changeset 36d56ea by Ned Deily (INADA Naoki) in branch 'master':
    bpo-33295: Skip test using missing external site (GH-6504)
    36d56ea

    @ned-deily
    Copy link
    Member

    New changeset f7379dd by Ned Deily (Miss Islington (bot)) in branch '3.7':
    bpo-33295: Skip test using missing external site (GH-6504) (GH-6509)
    f7379dd

    @ned-deily
    Copy link
    Member

    New changeset afc768d by Ned Deily (Miss Islington (bot)) in branch '2.7':
    bpo-33295: Skip test using missing external site (GH-6504) (GH-6510)
    afc768d

    @ned-deily
    Copy link
    Member

    New changeset f1547d1 by Ned Deily (Miss Islington (bot)) in branch '3.6':
    bpo-33295: Skip test using missing external site (GH-6504) (GH-6511)
    f1547d1

    @ned-deily
    Copy link
    Member

    Thanks! I force-merged the skips of the test so that Travis CI and buildbots were not failing. I'll leave the issue open so we can decide what to do about the test long term.

    @berkerpeksag
    Copy link
    Member

    I initially thought about using pythontest.net but I don't think it's possible to remove the Connection header at the nginx level: https://github.com/python/psf-salt/blob/master/salt/pythontest/config/nginx.pythontest.conf.jinja

    I think our only option is to create a local server for the test. I'm not sure it's an important enough use case, though.

    @berkerpeksag berkerpeksag added the type-bug An unexpected behavior, bug, or error label Apr 17, 2018
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @methane methane closed this as completed May 6, 2022
    @arunsl
    Copy link

    arunsl commented May 19, 2022

    Can't we just mock the response header and test this with a known url like python.org and simulate the scenario?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants