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

Got a 113 error when running the test_socket #81764

Closed
shihai1991 opened this issue Jul 13, 2019 · 12 comments
Closed

Got a 113 error when running the test_socket #81764

shihai1991 opened this issue Jul 13, 2019 · 12 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@shihai1991
Copy link
Member

BPO 37583
Nosy @vstinner, @miss-islington, @tirkarthi, @shihai1991
PRs
  • bpo-37583: Update support.get_socket_conn_refused_errs() #14729
  • [3.8] bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729) #15258
  • [3.7] bpo-37583: Update support.get_socket_conn_refused_errs() #15259
  • Files
  • test_socket_fail_info.txt
  • test_socket_fail_info_v2.txt
  • 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 2019-08-14.09:55:35.399>
    created_at = <Date 2019-07-13.08:34:31.149>
    labels = ['3.7', '3.8', 'type-feature', 'tests', '3.9']
    title = 'Got a 113 error when running the test_socket'
    updated_at = <Date 2019-08-14.09:55:35.392>
    user = 'https://github.com/shihai1991'

    bugs.python.org fields:

    activity = <Date 2019-08-14.09:55:35.392>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-14.09:55:35.399>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2019-07-13.08:34:31.149>
    creator = 'shihai1991'
    dependencies = []
    files = ['48480', '48538']
    hgrepos = []
    issue_num = 37583
    keywords = ['patch']
    message_count = 12.0
    messages = ['347786', '347800', '347862', '347902', '347904', '349127', '349468', '349479', '349590', '349596', '349665', '349666']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'miss-islington', 'xtreak', 'shihai1991']
    pr_nums = ['14729', '15258', '15259']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue37583'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @shihai1991
    Copy link
    Member Author

    When I run test_socket.py, I got a error. Looks it's a problem of security group.
    My env: a vm of centos
    May be I need add EHOSTUNREACH in support.get_socket_conn_refused_errs()?

    ======================================================================
    FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shihai/workspace/cpython/Lib/test/test_socket.py", line 4961, in test_create_connection
        self.assertIn(cm.exception.errno, expected_errnos)
    AssertionError: 113 not found in [111, 101, 99, 97]

    Ran 814 tests in 25.929s

    FAILED (failures=1, errors=117, skipped=197)

    @shihai1991 shihai1991 added the tests Tests in the Lib/test dir label Jul 13, 2019
    @tirkarthi
    Copy link
    Member

    Victor handled similar errors in bpo-36629 where this helper was introduced.

    @tirkarthi tirkarthi added 3.9 only security fixes type-feature A feature request or enhancement labels Jul 13, 2019
    @shihai1991
    Copy link
    Member Author

    So I add this 113 error in get_socket_conn_refused_errs too ;)

    @vstinner
    Copy link
    Member

    Can you copy/paste the full output of test_socket, or better: of the whole test suite? Put it in a file and attach it to the issue.

    @shihai1991
    Copy link
    Member Author

    sure, i copied the full output of test_socket. more failed test case looks like need add two property functions.

    @shihai1991
    Copy link
    Member Author

    ping :)

    @vstinner
    Copy link
    Member

    I don't understand such error:

    ======================================================================
    ERROR: testSendmsgBadMultiCmsg (test.test_socket.SendmsgTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/shihai/workspace/cpython/Lib/test/test_socket.py", line 2649, in setUp
        self.serv_sock.settimeout(self.fail_timeout)
    AttributeError: 'SendmsgTests' object has no attribute 'serv_sock'

    @shihai1991
    Copy link
    Member Author

    Oh, sorry, victor. I use ./python -m unittest xxx before.

    Updating the test result again.

    @vstinner
    Copy link
    Member

    New changeset 1ac2a83 by Victor Stinner (Hai Shi) in branch 'master':
    bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)
    1ac2a83

    @miss-islington
    Copy link
    Contributor

    New changeset ee98951 by Miss Islington (bot) in branch '3.8':
    bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)
    ee98951

    @vstinner
    Copy link
    Member

    New changeset fbb0c03 by Victor Stinner (Hai Shi) in branch '3.7':
    bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-15259)
    fbb0c03

    @vstinner
    Copy link
    Member

    Thanks Hai Shi for the bug report and the fix. It's now fixd in 3.7, 3.8 and master branches.

    First I understood that you wanted to modify transient_internet() which is used in many places. Fixing support.get_socket_conn_refused_errs() is fine, it's only used in 2 test functions.

    I don't think that it's worth it to fix Python 2.7 (which doesn't have get_socket_conn_refused_errs() function but build errno list directly in test_socket).

    @vstinner vstinner added 3.7 (EOL) end of life 3.8 only security fixes labels Aug 14, 2019
    @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.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants