classification
Title: test_asyncio: test_subprocess test_stdin_broken_pipe() failure on Travis CI
Type: Stage:
Components: asyncio, Tests Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, christian.heimes, eitan.adler, terry.reedy, vstinner, yselivanov
Priority: normal Keywords:

Created on 2018-05-16 06:29 by vstinner, last changed 2018-05-21 17:25 by asvetlov.

Messages (6)
msg316770 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-16 06:29
https://travis-ci.org/python/cpython/jobs/379560387

======================================================================
FAIL: test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessFastWatcherTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/python/cpython/Lib/test/test_asyncio/test_subprocess.py", line 214, in test_stdin_broken_pipe
    self.loop.run_until_complete, coro)
AssertionError: (<class 'BrokenPipeError'>, <class 'ConnectionResetError'>) not raised by run_until_complete

======================================================================
FAIL: test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/python/cpython/Lib/test/test_asyncio/test_subprocess.py", line 214, in test_stdin_broken_pipe
    self.loop.run_until_complete, coro)
AssertionError: (<class 'BrokenPipeError'>, <class 'ConnectionResetError'>) not raised by run_until_complete

It looks like bpo-30382 which has been closed because it disappears from "AMD64 FreeBSD CURRENT Non-Debug 3.x", but this bug was already random.
msg316995 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-05-18 00:57
I have also gotten test_async errors on AppVeyor and MSTS Windows.

ERROR: test__sock_sendfile_native_failure (test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1881, in test__sock_sendfile_native_failure
    sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1866, in prepare
    self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1846, in run_loop
    return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in run_until_complete
    return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in sock_connect
    return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6284)
======================================================================
ERROR: test_sock_sendfile_fallback (test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1903, in test_sock_sendfile_fallback
    sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1866, in prepare
    self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1846, in run_loop
    return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in run_until_complete
    return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in sock_connect
    return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6303)
======================================================================
ERROR: test_sock_sendfile_fallback_offset_and_count (test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1914, in test_sock_sendfile_fallback_offset_and_count
    sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1866, in prepare
    self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1846, in run_loop
    return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in run_until_complete
    return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in sock_connect
    return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6308)
======================================================================
ERROR: test_sock_sendfile_no_fallback (test.test_asyncio.test_base_events.BaseLoopSockSendfileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1892, in test_sock_sendfile_no_fallback
    sock, proto = self.prepare()
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1866, in prepare
    self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
  File "C:\projects\cpython\lib\test\test_asyncio\test_base_events.py", line 1846, in run_loop
    return self.loop.run_until_complete(coro)
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in run_until_complete
    return future.result()
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 475, in sock_connect
    return await fut
  File "C:\projects\cpython\lib\asyncio\selector_events.py", line 505, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 6338)
----------------------------------------------------------------------
Ran 1729 tests in 89.932s

Before that, for Brett
test_popen (test.test_asyncio.test_windows_utils.PopenTests) ... Warning -- asyncio.get_event_loop_policy was modified by test_asyncio
  Before: <asyncio.windows_events._WindowsDefaultEventLoopPolicy object at 0x03DA7850>
  After:  <asyncio.windows_events._WindowsDefaultEventLoopPolicy object at 0x0436F410> 
test test_asyncio crashed -- Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\libregrtest\runtest.py", line 179, in runtest_inner
    test_time = time.time() - start_time
  File "C:\projects\cpython\lib\test\libregrtest\save_env.py", line 305, in __exit__
    current = get()
  File "C:\projects\cpython\lib\test\libregrtest\save_env.py", line 80, in get_asyncio_get_event_loop
    return asyncio.get_event_loop()
  File "C:\projects\cpython\lib\asyncio\events.py", line 645, in get_event_loop
    % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'MainThread'.
C:\projects\cpython\lib\asyncio\base_events.py:605: ResourceWarning: unclosed event loop <_WindowsSelectorEventLoop running=False closed=False debug=False>
  source=self)
ok
----------------------------------------------------------------------
Ran 1729 tests in 25.061s
OK (skipped=66)
1 test failed again:
    test_asyncio

Before that, Brett got both sets of errors.

Before that, three jobs got the 4 ConnectionRefused errors.
msg316996 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-05-18 01:04
I just got the two broken pipe error on Travis.
msg316998 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-05-18 01:24
The Travis retest (for 3.7 backport) just failed with the same errors.  Why can't we disable this tests.  It now takes hours to do a merge with two backports.
msg317081 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-19 00:42
Terry: " The Travis retest (for 3.7 backport) just failed with the same errors.  Why can't we disable this tests.  It now takes hours to do a merge with two backports."

Usually, I prefer to try to understand a bug before disabling, even temporarely, a test. Most of the time, a test failure means a regression. If we disable a test, we reduce the code coverage and more generally reduces the quality of the code.

I would prefer to only disable the test if nobody understand the issue and the issue blocks the workflow longer than a few days. This week, there was a CPython sprint during Pycon US, so yeah, it was annoying.
msg317242 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-05-21 17:25
Fixed failed sendfile tests on Windows (at least I hope so).
History
Date User Action Args
2018-05-21 17:25:09asvetlovsetmessages: + msg317242
2018-05-19 09:33:03christian.heimessetnosy: + christian.heimes
2018-05-19 00:42:04vstinnersetmessages: + msg317081
2018-05-18 01:24:52terry.reedysetmessages: + msg316998
2018-05-18 01:04:37terry.reedysetmessages: + msg316996
2018-05-18 00:57:14terry.reedysetnosy: + terry.reedy
messages: + msg316995
2018-05-16 06:32:28eitan.adlersetnosy: + eitan.adler
2018-05-16 06:29:52vstinnercreate