python / cpython

The Python programming language
https://www.python.org
Other
63.39k stars 30.36k forks source link

Test failures under macOS 10.12 Sierra #72642

Closed rhettinger closed 8 years ago

rhettinger commented 8 years ago
BPO 28456
Nosy @rhettinger, @ronaldoussoren, @vstinner, @ned-deily, @ambv
Superseder
  • bpo-28087: macOS 12 poll syscall returns prematurely
  • 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: ```python assignee = None closed_at = created_at = labels = ['interpreter-core'] title = 'Test failures under macOS 10.12 Sierra' updated_at = user = 'https://github.com/rhettinger' ``` bugs.python.org fields: ```python activity = actor = 'ned.deily' assignee = 'none' closed = True closed_date = closer = 'ned.deily' components = ['Interpreter Core'] creation = creator = 'rhettinger' dependencies = [] files = [] hgrepos = [] issue_num = 28456 keywords = [] message_count = 4.0 messages = ['278780', '278781', '278782', '278787'] nosy_count = 5.0 nosy_names = ['rhettinger', 'ronaldoussoren', 'vstinner', 'ned.deily', 'lukasz.langa'] pr_nums = [] priority = 'normal' resolution = 'duplicate' stage = 'resolved' status = 'closed' superseder = '28087' type = None url = 'https://bugs.python.org/issue28456' versions = ['Python 3.6'] ```

    rhettinger commented 8 years ago

    On a fresh checkout, I'm getting two test failures:

    $ ./configure && make
    $ ./python.exe -m test.regrtest -v test_asyncore
         [snip]

    ====================================================================== FAIL: test_handle_expt (test.test_asyncore.TestAPI_UseIPv4Poll) ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 674, in test_handle_expt
        self.loop_waiting_for_flag(client)
      File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 514, in loop_waiting_for_flag
        self.fail("flag not set")
    AssertionError: flag not set

    ====================================================================== FAIL: test_handle_expt (test.test_asyncore.TestAPI_UseIPv6Poll) ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 674, in test_handle_expt
        self.loop_waiting_for_flag(client)
      File "/Users/raymond/cleancpython/Lib/test/test_asyncore.py", line 514, in loop_waiting_for_flag
        self.fail("flag not set")
    AssertionError: flag not set

    Ran 101 tests in 20.506s

    FAILED (failures=2, skipped=6) test test_asyncore failed test_asyncore failed

    1 test failed: test_asyncore

    $ ./python.exe -m test.regrtest -v test_eintr
      [snip]

    ====================================================================== FAIL: test_poll (main.SelectEINTRTest) ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 446, in test_poll
        self.assertGreaterEqual(dt, self.sleep_time)
    AssertionError: 9.176997991744429e-06 not greater than or equal to 0.2

    Ran 22 tests in 5.288s

    FAILED (failures=1, skipped=5) ---

    stderr: ---

    Traceback (most recent call last):
      File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 492, in <module>
        test_main()
      File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 488, in test_main
        SelectEINTRTest)
      File "/Users/raymond/cleancpython/Lib/test/support/__init__.py", line 1849, in run_unittest
        _run_suite(suite)
      File "/Users/raymond/cleancpython/Lib/test/support/__init__.py", line 1824, in _run_suite
        raise TestFailed(err)
    test.support.TestFailed: Traceback (most recent call last):
      File "/Users/raymond/cleancpython/Lib/test/eintrdata/eintr_tester.py", line 446, in test_poll
        self.assertGreaterEqual(dt, self.sleep_time)
    AssertionError: 9.176997991744429e-06 not greater than or equal to 0.2
    ---
    

    Ran 1 test in 5.424s

    FAILED (failures=1) test test_eintr failed test_eintr failed

    1 test failed: test_eintr

    Total duration: 5 sec Tests result: FAILURE

    vstinner commented 8 years ago

    See https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/

    C function poll() seems to be broken on Sierra.

    vstinner commented 8 years ago

    Try to modify pyconfig.h to define HAVE_BROKEN_POLL. It should work around the bug.

    configure.ac contains a test for HAVE_BROKEN_POLL. We need another test for poll() being broken differently.

    Note: asyncio doesn't seem to be affect because it probably uses the more efficient kqueue by default on OS X.

    ned-deily commented 8 years ago

    This is a duplicate of bpo-28087.