This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Got a 113 error when running the test_socket
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, shihai1991, vstinner, xtreak
Priority: normal Keywords: patch

Created on 2019-07-13 08:34 by shihai1991, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_socket_fail_info.txt shihai1991, 2019-07-14 10:30
test_socket_fail_info_v2.txt shihai1991, 2019-08-12 16:33
Pull Requests
URL Status Linked Edit
PR 14729 merged shihai1991, 2019-07-13 08:37
PR 15258 merged miss-islington, 2019-08-13 17:38
PR 15259 merged shihai1991, 2019-08-13 17:55
Messages (12)
msg347786 - (view) Author: Hai Shi (shihai1991) * (Python triager) Date: 2019-07-13 08:34
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)
msg347800 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-07-13 10:32
Victor handled similar errors in issue36629 where this helper was introduced.
msg347862 - (view) Author: Hai Shi (shihai1991) * (Python triager) Date: 2019-07-14 03:27
So I add this 113 error in `get_socket_conn_refused_errs` too ;)
msg347902 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-14 09:37
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.
msg347904 - (view) Author: Hai Shi (shihai1991) * (Python triager) Date: 2019-07-14 10:30
sure, i copied the full output of test_socket. more failed test case looks like need add two property functions.
msg349127 - (view) Author: Hai Shi (shihai1991) * (Python triager) Date: 2019-08-06 17:49
ping :)
msg349468 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-12 13:16
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'
msg349479 - (view) Author: Hai Shi (shihai1991) * (Python triager) Date: 2019-08-12 16:33
Oh, sorry, victor. I use ./python -m unittest xxx before.

Updating the test result again.
msg349590 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-13 17:38
New changeset 1ac2a83f30312976502fda042db5ce18d10ceec2 by Victor Stinner (Hai Shi) in branch 'master':
bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)
https://github.com/python/cpython/commit/1ac2a83f30312976502fda042db5ce18d10ceec2
msg349596 - (view) Author: miss-islington (miss-islington) Date: 2019-08-13 18:11
New changeset ee989512528d178d6f088916aba3e67ea9487ceb by Miss Islington (bot) in branch '3.8':
bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)
https://github.com/python/cpython/commit/ee989512528d178d6f088916aba3e67ea9487ceb
msg349665 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-14 09:52
New changeset fbb0c032e89c42ab44f5372df40fffb34a91b575 by Victor Stinner (Hai Shi) in branch '3.7':
bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-15259)
https://github.com/python/cpython/commit/fbb0c032e89c42ab44f5372df40fffb34a91b575
msg349666 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-14 09:55
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).
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81764
2019-08-14 09:55:35vstinnersetstatus: open -> closed
versions: + Python 3.7, Python 3.8
messages: + msg349666

resolution: fixed
stage: patch review -> resolved
2019-08-14 09:52:40vstinnersetmessages: + msg349665
2019-08-13 18:11:53miss-islingtonsetnosy: + miss-islington
messages: + msg349596
2019-08-13 17:55:52shihai1991setpull_requests: + pull_request14978
2019-08-13 17:38:12miss-islingtonsetpull_requests: + pull_request14977
2019-08-13 17:38:07vstinnersetmessages: + msg349590
2019-08-12 16:33:22shihai1991setfiles: + test_socket_fail_info_v2.txt

messages: + msg349479
2019-08-12 13:16:21vstinnersetmessages: + msg349468
2019-08-06 17:49:17shihai1991setmessages: + msg349127
2019-07-14 10:30:19shihai1991setfiles: + test_socket_fail_info.txt

messages: + msg347904
2019-07-14 09:37:34vstinnersetmessages: + msg347902
2019-07-14 03:27:13shihai1991setmessages: + msg347862
2019-07-13 10:32:16xtreaksetversions: + Python 3.9
nosy: + xtreak, vstinner

messages: + msg347800

type: enhancement
2019-07-13 08:37:52shihai1991setkeywords: + patch
stage: patch review
pull_requests: + pull_request14523
2019-07-13 08:34:31shihai1991create