classification
Title: [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure
Type: behavior Stage: needs patch
Components: asyncio, Tests, Windows Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: aeros, asvetlov, erlendaasland, ncoghlan, sobolevn, terry.reedy, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2020-09-01 01:20 by aeros, last changed 2021-09-21 08:53 by sobolevn.

Messages (8)
msg376175 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2020-09-01 01:24
In an unrelated PR to add a new argument to the base Executor class for concurrent.futures, there was a test_asyncio failure in test_sendfile for the ProactorEventLoop tests:

======================================================================
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 452, in test_sendfile_close_peer_in_the_middle_of_receiving
    self.run_loop(
AssertionError: ConnectionError not raised

----------------------------------------------------------------------

https://github.com/python/cpython/pull/22023/checks?check_run_id=1049760805#step:5:2373
msg376176 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2020-09-01 01:36
In case the link to the logs are lost from closing and reopening the PR, it was a Windows CI test (GitHub actions) ran with the following configuration:

D:\a\cpython\cpython>"D:\a\cpython\cpython\PCbuild\amd64\python.exe"  -u -Wd -E -bb -m test  -uall -u-cpu -rwW --slowest --timeout 1200 -j0 
== CPython 3.10.0a0 (remotes/pull/22023/merge:992cc27, Aug 31 2020, 06:11:21) [MSC v.1927 64 bit (AMD64)]
== Windows-10-10.0.17763-SP0 little-endian
== cwd: D:\a\cpython\cpython\build\test_python_6372�
== CPU count: 2
== encodings: locale=cp1252, FS=utf-8
Using random seed 491155
0:00:00 Run tests in parallel using 4 child processes (timeout: 20 min, worker timeout: 25 min)
msg391134 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-15 12:53
I marked bpo-42124 and bpo-43539 as a duplicate of this issue.
msg392061 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2021-04-27 12:27
Another instance at https://github.com/python/cpython/pull/25585/checks?check_run_id=2447701034

I unlinked the previously linked PR, as that looked to be for bpo-43539 rather than this issue.
msg396238 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-06-21 12:23
This bug still occurs time to time on GitHub Actions.

https://github.com/python/cpython/pull/26826/checks?check_run_id=2874631119

======================================================================
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving
    with self.assertRaises(ConnectionError):
AssertionError: ConnectionError not raised
msg396503 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-06-24 16:56
Two new failures today:

https://github.com/python/cpython/runs/2905621215:
2021-06-24T14:18:23.3772681Z ======================================================================
2021-06-24T14:18:23.3773622Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests)
2021-06-24T14:18:23.3774665Z ----------------------------------------------------------------------
2021-06-24T14:18:23.3775258Z Traceback (most recent call last):
2021-06-24T14:18:23.3776123Z   File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving
2021-06-24T14:18:23.3777065Z     with self.assertRaises(ConnectionError):
2021-06-24T14:18:23.3777775Z AssertionError: ConnectionError not raised
2021-06-24T14:18:23.3778226Z 
2021-06-24T14:18:23.3778744Z ----------------------------------------------------------------------
2021-06-24T14:18:23.3779161Z 
2021-06-24T14:18:23.3779555Z Ran 2022 tests in 54.341s
2021-06-24T14:18:23.3779870Z 
2021-06-24T14:18:23.3780352Z FAILED (failures=1, skipped=63)
2021-06-24T14:18:23.3780890Z test test_asyncio failed


https://github.com/python/cpython/runs/2906141524:
2021-06-24T15:23:11.7177493Z ======================================================================
2021-06-24T15:23:11.7178338Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests)
2021-06-24T15:23:11.7179234Z ----------------------------------------------------------------------
2021-06-24T15:23:11.7179754Z Traceback (most recent call last):
2021-06-24T15:23:11.7180469Z   File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving
2021-06-24T15:23:11.7181284Z     with self.assertRaises(ConnectionError):
2021-06-24T15:23:11.7182125Z AssertionError: ConnectionError not raised
2021-06-24T15:23:11.7182560Z 
2021-06-24T15:23:11.7183334Z ----------------------------------------------------------------------
2021-06-24T15:23:11.7183839Z
msg399770 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-08-17 17:01
Recent failure on GHA Windows x64:

https://github.com/python/cpython/runs/3342514542

2021-08-16T17:19:58.4338049Z ======================================================================
2021-08-16T17:19:58.4339129Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests)
2021-08-16T17:19:58.4340315Z ----------------------------------------------------------------------
2021-08-16T17:19:58.4340937Z Traceback (most recent call last):
2021-08-16T17:19:58.4341846Z   File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving
2021-08-16T17:19:58.4342849Z     with self.assertRaises(ConnectionError):
2021-08-16T17:19:58.4343398Z     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2021-08-16T17:19:58.4343982Z AssertionError: ConnectionError not raised
msg402294 - (view) Author: Nikita Sobolev (sobolevn) * Date: 2021-09-21 08:53
Happened to me today: https://dev.azure.com/Python/cpython/_build/results?buildId=88208&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334&t=5a421c4a-0933-53d5-26b9-04b36ad165eb


```
test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) ... FAIL
test test_asyncio failed
test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.SelectEventLoopTests) ... ok

======================================================================
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\1\s\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving
    with self.assertRaises(ConnectionError):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: ConnectionError not raised

----------------------------------------------------------------------
Ran 2 tests in 0.087s

FAILED (failures=1)
0:08:56 load avg: 3.51 Re-running test_concurrent_futures in verbose mode (matching: test_cancel_futures_wait_false)
test_cancel_futures_wait_false (test.test_concurrent_futures.ThreadPoolShutdownTest) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.303s

OK
1 test failed again:
    test_asyncio
```
History
Date User Action Args
2021-09-21 08:53:33sobolevnsetnosy: + sobolevn
messages: + msg402294
2021-09-07 16:41:26iritkatriellinkissue34262 superseder
2021-08-17 17:01:50vstinnersetmessages: + msg399770
2021-06-24 16:56:06erlendaaslandsetnosy: + erlendaasland
messages: + msg396503
2021-06-24 16:55:23erlendaaslandlinkissue44506 superseder
2021-06-21 12:23:47vstinnersetmessages: + msg396238
2021-04-27 12:28:11ncoghlansetstage: patch review -> needs patch
2021-04-27 12:27:58ncoghlansetnosy: + ncoghlan
messages: + msg392061
2021-04-27 12:26:45ncoghlansetpull_requests: - pull_request24157
2021-04-15 12:53:39vstinnersetnosy: + terry.reedy
2021-04-15 12:53:32vstinnersettitle: test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure -> [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure
2021-04-15 12:53:11vstinnersetmessages: + msg391134
2021-04-15 12:53:00vstinnerlinkissue43539 superseder
2021-04-15 12:52:37vstinnerlinkissue42124 superseder
2021-04-15 12:51:33vstinnersetkeywords: + patch
nosy: + vstinner

pull_requests: + pull_request24157
stage: patch review
2020-09-01 01:51:47aerossetnosy: - paul.moore, tim.golden, zach.ware, steve.dower
2020-09-01 01:51:13aerossetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
components: + Windows, asyncio
2020-09-01 01:36:41aerossetmessages: + msg376176
2020-09-01 01:26:06aerossetnosy: + asvetlov, yselivanov

type: behavior
components: + Tests
versions: + Python 3.10
2020-09-01 01:24:09aerossetmessages: + msg376175
title: test_asyncio: Proactor -> test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure
2020-09-01 01:20:55aeroscreate