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

test_urllib2.test_issue16464() fails randomly #90809

Closed
vstinner opened this issue Feb 5, 2022 · 2 comments
Closed

test_urllib2.test_issue16464() fails randomly #90809

vstinner opened this issue Feb 5, 2022 · 2 comments
Labels
3.11 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Feb 5, 2022

BPO 46651
Nosy @vstinner
Superseder
  • bpo-46648: test.test_urllib2.MiscTests.test_issue16464 flaky due to external connection
  • 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 = <Date 2022-02-05.17:59:58.693>
    created_at = <Date 2022-02-05.17:57:15.906>
    labels = ['tests', '3.11']
    title = 'test_urllib2.test_issue16464() fails randomly'
    updated_at = <Date 2022-02-05.17:59:58.691>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2022-02-05.17:59:58.691>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-02-05.17:59:58.693>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2022-02-05.17:57:15.906>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46651
    keywords = []
    message_count = 2.0
    messages = ['412586', '412587']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '46648'
    type = None
    url = 'https://bugs.python.org/issue46651'
    versions = ['Python 3.11']

    @vstinner
    Copy link
    Member Author

    vstinner commented Feb 5, 2022

    test_urllib2.test_issue16464() fails randomly.

    It uses http://www.example.com/ server.

    Instead, I proposed to use http://httpbin.org/post URL which is written to support HTTP POST.

    $ ./python -m test test_urllib2 -u all -v -m test_issue16464

    ======================================================================
    ERROR: test_issue16464 (test.test_urllib2.MiscTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/vstinner/python/main/Lib/contextlib.py", line 155, in __exit__
        self.gen.throw(typ, value, traceback)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/vstinner/python/main/Lib/test/support/socket_helper.py", line 245, in transient_internet
        yield
        ^^^^^
      File "/home/vstinner/python/main/Lib/test/test_urllib2.py", line 1799, in test_issue16464
        opener.open(request, "1".encode("us-ascii"))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/vstinner/python/main/Lib/urllib/request.py", line 525, in open
        response = meth(req, response)
                   ^^^^^^^^^^^^^^^^^^^
      File "/home/vstinner/python/main/Lib/urllib/request.py", line 634, in http_response
        response = self.parent.error(
                   ^^^^^^^^^^^^^^^^^^
      File "/home/vstinner/python/main/Lib/urllib/request.py", line 563, in error
        return self._call_chain(*args)
               ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/vstinner/python/main/Lib/urllib/request.py", line 496, in _call_chain
        result = func(*args)
                 ^^^^^^^^^^^
      File "/home/vstinner/python/main/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

    @vstinner vstinner added 3.11 only security fixes tests Tests in the Lib/test dir labels Feb 5, 2022
    @vstinner
    Copy link
    Member Author

    vstinner commented Feb 5, 2022

    Oh, bpo-46648 was already opened.

    @vstinner vstinner closed this as completed Feb 5, 2022
    @vstinner vstinner closed this as completed Feb 5, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant