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.test_logging.SMTPHandlerTest failing on Snow Leopard #67400

Closed
Wooble mannequin opened this issue Jan 9, 2015 · 7 comments
Closed

test.test_logging.SMTPHandlerTest failing on Snow Leopard #67400

Wooble mannequin opened this issue Jan 9, 2015 · 7 comments
Labels
OS-mac tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@Wooble
Copy link
Mannequin

Wooble mannequin commented Jan 9, 2015

BPO 23211
Nosy @vsajip, @ronaldoussoren, @ned-deily, @Wooble
Files
  • issue23211.patch
  • 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 2015-01-18.01:02:20.313>
    created_at = <Date 2015-01-09.19:43:52.289>
    labels = ['OS-mac', 'type-bug', 'tests']
    title = 'test.test_logging.SMTPHandlerTest failing on Snow Leopard'
    updated_at = <Date 2015-01-18.01:36:29.013>
    user = 'https://github.com/Wooble'

    bugs.python.org fields:

    activity = <Date 2015-01-18.01:36:29.013>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-01-18.01:02:20.313>
    closer = 'ned.deily'
    components = ['macOS', 'Tests']
    creation = <Date 2015-01-09.19:43:52.289>
    creator = 'geoffreyspear'
    dependencies = []
    files = ['37717']
    hgrepos = []
    issue_num = 23211
    keywords = ['patch']
    message_count = 7.0
    messages = ['233779', '234097', '234130', '234208', '234209', '234212', '234213']
    nosy_count = 5.0
    nosy_names = ['vinay.sajip', 'ronaldoussoren', 'ned.deily', 'geoffreyspear', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue23211'
    versions = ['Python 3.4', 'Python 3.5']

    @Wooble
    Copy link
    Mannequin Author

    Wooble mannequin commented Jan 9, 2015

    This seems to be related to bpo-20605 where _socket.getaddrinfo() mysteriously fails on some Snow Leopard systems but not others; I don't think the cause of that one was ever explained but this appears to be the same error:

    ======================================================================
    ERROR: test_basic (test.test_logging.SMTPHandlerTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Users/geoff/Documents/programming/cpython/Lib/test/test_logging.py", line 930, in test_basic
        sockmap)
      File "/Users/geoff/Documents/programming/cpython/Lib/test/test_logging.py", line 687, in __init__
        decode_data=True)
      File "/Users/geoff/Documents/programming/cpython/Lib/smtpd.py", line 654, in __init__
        type=socket.SOCK_STREAM)
      File "/Users/geoff/Documents/programming/cpython/Lib/socket.py", line 730, in getaddrinfo
        for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    socket.gaierror: [Errno 8] nodename nor servname provided, or not known

    @Wooble Wooble mannequin added OS-mac tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Jan 9, 2015
    @ned-deily
    Copy link
    Member

    Yes, this has the same root cause as the failure in bpo-20605 since SMTPServer in smtpd.py uses getaddrinfo. I'm now able to reliably reproduce the failure. The system getaddrinfo failure is seen when the OS X 10.6 system's network configuration is *not* using the local mdns for its primary domain service (which can be checked with "scutil --dns"); it fails when using an external dns as its primary dns service. At least that's one failure scenario. In any case, this seems to have been fixed in later versions of OS X, the problem appears to be unique to getaddrinfo (gethostbyname works OK), and it's only this one test. I'm tempted to just close this as "won't fix"; on the other hand, it's easy enough to change this test to use '127.0.0.0' instead of 'localhost'; there are precedents for doing that for other reasons (bpo-18792, for example). Here's a patch that does so and thus avoids the potential problem on 10.6. I'll apply it if there are no objections.

    @vsajip
    Copy link
    Member

    vsajip commented Jan 16, 2015

    No objections from me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 18, 2015

    New changeset 90b664532d1c by Ned Deily in branch '3.4':
    Issue bpo-23211: Workaround test_logging failure on some OS X 10.6 systems:
    https://hg.python.org/cpython/rev/90b664532d1c

    New changeset e3dfe942697e by Ned Deily in branch 'default':
    Issue bpo-23211: merge from 3.4
    https://hg.python.org/cpython/rev/e3dfe942697e

    @ned-deily
    Copy link
    Member

    OK, the workaround is applied for 3.4.3 and 3.5.0.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 18, 2015

    New changeset 65ac2b992673 by Ned Deily in branch '3.4':
    Issue bpo-23211: Fix patch for 3.4 differences.
    https://hg.python.org/cpython/rev/65ac2b992673

    New changeset 2d71d0f954fb by Ned Deily in branch 'default':
    Issue bpo-23211: null merge
    https://hg.python.org/cpython/rev/2d71d0f954fb

    @ned-deily
    Copy link
    Member

    I *thought* I had tested 3.4 before; sorry about that!

    @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
    OS-mac tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants