You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x #77875
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=Noneclosed_at=<Date2018-06-09.16:44:39.217>created_at=<Date2018-05-30.11:19:38.205>labels= ['3.8', '3.7', 'tests', 'expert-asyncio']
title='test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x'updated_at=<Date2019-09-20.21:27:31.745>user='https://github.com/vstinner'
test_asyncio.test_start_tls_server_1() got many fixes recently: see bpo-32458 and bpo-33674... but it still fails on Python on x86 Windows7 3.x at revision bb9474f which contains all these fixes.
The test fails even when test_asyncio is re-run alone (not when other tests run in parallel).
Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_asyncio\test_sslproto.py", line 467, in test_start_tls_server_1self.loop.run_until_complete(run_main())
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\asyncio\base_events.py", line 566, in run_until_completeraiseRuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_asyncio\functional.py", line 42, in tearDownself.fail('unexpected calls to loop.call_exception_handler()')
AssertionError: unexpected calls to loop.call_exception_handler()
Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.7.bolen-windows7\build\lib\test\test_asyncio\test_sslproto.py", line 467, in test_start_tls_server_1self.loop.run_until_complete(run_main())
File "D:\cygwin\home\db3l\buildarea\3.7.bolen-windows7\build\lib\asyncio\base_events.py", line 566, in run_until_completeraiseRuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.7.bolen-windows7\build\lib\test\test_asyncio\functional.py", line 42, in tearDownself.fail('unexpected calls to loop.call_exception_handler()')
AssertionError: unexpected calls to loop.call_exception_handler()
I can't reproduce test_start_tls_server_1 fails when I do (screenshot attached)
run test_asyncio
run test_asyncio.test_sslproto
run test_asyncio.test_sslproto -m test_start_tls_server_1
I run them in Windows 7 VM on Mac OS.
All other tests pass fine for me except test_sendfile_close_peer_in_the_middle_of_receiving. Andrew, please look at this, this is your test, and I'm not sure I follow why we use SNDBUF at all. IMO it should be possible to write a test without using that (or if not, maybe time to use mocks).
With regards to start_tls tests -- I give up, I don't have time to look into this before 3.7.0. I suggest to mask the test on the specific win buildbot it crashes on and fix it before 3.7.1 (or maybe when Windows users come up with a reliable way to reproduce the bug).
I used SNDBUF to enforce send buffer overloading.
It is not required by sendfile tests but I thought that better to have non-mocked way to test such situations.
We can remove the socket buffers size manipulation at all without any problem.
The test also failed on AMD64 Windows8.1 Refleaks 3.7. This buildbot is also very slow because it runs reference leak hunting. It confirms that the remaining issue is a race condition which is only seen when the system becomes slow.
Traceback (most recent call last):
File "D:\buildarea\3.7.ware-win81-release.refleak\build\lib\test\test_asyncio\test_sslproto.py", line 467, in test_start_tls_server_1self.loop.run_until_complete(run_main())
File "D:\buildarea\3.7.ware-win81-release.refleak\build\lib\asyncio\base_events.py", line 566, in run_until_completeraiseRuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Traceback (most recent call last):
File "D:\buildarea\3.7.ware-win81-release.refleak\build\lib\test\test_asyncio\functional.py", line 42, in tearDownself.fail('unexpected calls to loop.call_exception_handler()')
AssertionError: unexpected calls to loop.call_exception_handler()
Traceback (most recent call last):
File "D:\buildarea\3.x.ware-win81-release\build\lib\test\test_asyncio\test_sslproto.py", line 623, in test_create_connection_ssl_failed_certificateself.loop.run_until_complete(client(srv.addr))
File "D:\buildarea\3.x.ware-win81-release\build\lib\asyncio\base_events.py", line 566, in run_until_completeraiseRuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
Traceback (most recent call last):
File "C:\projects\cpython\lib\test\test_asyncio\test_sslproto.py", line 623, in test_create_connection_ssl_failed_certificateself.loop.run_until_complete(client(srv.addr))
File "C:\projects\cpython\lib\asyncio\base_events.py", line 566, in run_until_completeraiseRuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
New changeset 8fa398d by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-33694: Fix race condition in asyncio proactor (GH-7498) (GH-7499) 8fa398d
I fixed the root issue, a race condition in ProactorEventLoop. But I prefer to keep the issue open a few days to see if the bug is really gone from all CIs.
It seems like Python 3.6 (at least the 3.6 development branch) doesn't have this bug.
It didn't see the bug recently, so I close the issue.
Python 3.6 has a different issue: pause_reading() cannot be called twice, same issue with resume_reading(). But I'm not sure that it can be called a bug. Python 3.7 allows to call these methods twice and to call these methods while closing: they just do nothing in that case.
pause_reading and resume_reading became idempotent only in 3.7
Do you consider that it's a new feature or a bugfix? Should we backport this change to 3.6? Currently, race.py fails with an error because of the 3.6 behaviour. (I modified asyncio to be able to run race.py on 3.6.)
Activity
vstinner commentedon May 30, 2018
test_asyncio.test_start_tls_server_1() got many fixes recently: see bpo-32458 and bpo-33674... but it still fails on Python on x86 Windows7 3.x at revision bb9474f which contains all these fixes.
The test fails even when test_asyncio is re-run alone (not when other tests run in parallel).
http://buildbot.python.org/all/#/builders/58/builds/930
======================================================================
ERROR: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
======================================================================
FAIL: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
The test fails also on x86 Windows7 3.7:
======================================================================
ERROR: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
======================================================================
FAIL: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
Moreover, 3.7 got an additional failure:
======================================================================
ERROR: test_pipe_handle (test.test_asyncio.test_windows_utils.PipeTests)
----------------------------------------------------------------------
The Windows7 buildbot is known to be slow. For example, test_value() of test_multiprocessing_spawn failed with a timeout (15 min) on x86 Windows7 3.x:
0:48:12 [276/416/1] test_multiprocessing_spawn crashed (Exit code 1)
Timeout (0:15:00)!
Thread 0x000008e4 (most recent call first):
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\popen_spawn_win32.py", line 80 in wait
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py", line 140 in join
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py", line 1925 in test_value
Maybe something is wrong with my karma, I don't know. Or test_asyncio just hate me.
vstinner commentedon May 30, 2018
The test fails also on x86 Windows7 3.7:
http://buildbot.python.org/all/#/builders/111/builds/297
1st1 commentedon May 30, 2018
I can't reproduce test_start_tls_server_1 fails when I do (screenshot attached)
I run them in Windows 7 VM on Mac OS.
All other tests pass fine for me except test_sendfile_close_peer_in_the_middle_of_receiving. Andrew, please look at this, this is your test, and I'm not sure I follow why we use SNDBUF at all. IMO it should be possible to write a test without using that (or if not, maybe time to use mocks).
With regards to start_tls tests -- I give up, I don't have time to look into this before 3.7.0. I suggest to mask the test on the specific win buildbot it crashes on and fix it before 3.7.1 (or maybe when Windows users come up with a reliable way to reproduce the bug).
asvetlov commentedon May 30, 2018
I used SNDBUF to enforce send buffer overloading.
It is not required by sendfile tests but I thought that better to have non-mocked way to test such situations.
We can remove the socket buffers size manipulation at all without any problem.
1st1 commentedon May 30, 2018
When I tried to do that I think I was having more failures with that test. But really up to you.
vstinner commentedon May 30, 2018
What is that? Would you mind to elaborate? I'm curious :-)
vstinner commentedon Jun 1, 2018
The test also failed on AMD64 Windows8.1 Refleaks 3.7. This buildbot is also very slow because it runs reference leak hunting. It confirms that the remaining issue is a race condition which is only seen when the system becomes slow.
http://buildbot.python.org/all/#/builders/132/builds/154
======================================================================
ERROR: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
======================================================================
FAIL: test_start_tls_server_1 (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
pablogsal commentedon Jun 3, 2018
The test fails also on x86 Windows7 3.x:
http://buildbot.python.org/all/#/builders/58/builds/947
vstinner commentedon Jun 4, 2018
A variant of the bug?
AMD64 Windows8.1 Non-Debug 3.x:
http://buildbot.python.org/all/#/builders/12/builds/948
======================================================================
ERROR: test_create_connection_ssl_failed_certificate (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
vstinner commentedon Jun 4, 2018
Not surprising: same error on AMD64 Windows8.1 Non-Debug 3.7:
http://buildbot.python.org/all/#builders/133/builds/304
vstinner commentedon Jun 6, 2018
Another variant seen on AppVeyor (PR 7439, master branch):
https://ci.appveyor.com/project/python/cpython/build/3.8build16980
======================================================================
ERROR: test_create_connection_ssl_failed_certificate (test.test_asyncio.test_sslproto.ProactorStartTLSTests)
----------------------------------------------------------------------
10 remaining items
vstinner commentedon Jun 7, 2018
New changeset 8fa398d by Victor Stinner (Miss Islington (bot)) in branch '3.7':
bpo-33694: Fix race condition in asyncio proactor (GH-7498) (GH-7499)
8fa398d
vstinner commentedon Jun 8, 2018
I fixed the root issue, a race condition in ProactorEventLoop. But I prefer to keep the issue open a few days to see if the bug is really gone from all CIs.
vstinner commentedon Jun 8, 2018
New changeset ff6c077 by Victor Stinner in branch 'master':
bpo-33694: Fix typo in helper function name (GH-7522)
ff6c077
miss-islington commentedon Jun 8, 2018
New changeset 17beebc by Miss Islington (bot) in branch '3.7':
bpo-33694: Fix typo in helper function name (GH-7522)
17beebc
vstinner commentedon Jun 9, 2018
I ran attached race.py on the 3.6 branch:
It seems like Python 3.6 (at least the 3.6 development branch) doesn't have this bug.
It didn't see the bug recently, so I close the issue.
Python 3.6 has a different issue: pause_reading() cannot be called twice, same issue with resume_reading(). But I'm not sure that it can be called a bug. Python 3.7 allows to call these methods twice and to call these methods while closing: they just do nothing in that case.
I close the issue.
1st1 commentedon Jun 9, 2018
pause_reading and resume_reading became idempotent only in 3.7
vstinner commentedon Jun 10, 2018
Do you consider that it's a new feature or a bugfix? Should we backport this change to 3.6? Currently, race.py fails with an error because of the 3.6 behaviour. (I modified asyncio to be able to run race.py on 3.6.)
1st1 commentedon Jun 10, 2018
Since it a minor change we can reconsider it as s bug fix. Feel free to make a pr.
vstinner commentedon Jun 11, 2018
"Since it a minor change we can reconsider it as s bug fix. Feel free
to make a pr."
Ok, I created #7629 for bpo-32356
vstinner commentedon Jun 13, 2018
New changeset 142e3c0 by Victor Stinner in branch '3.6':
[3.6] bpo-32356: idempotent pause_/resume_reading (GH-4914) (GH-7629)
142e3c0
vstinner commentedon Sep 20, 2019
New changeset bc2256e by Victor Stinner in branch 'master':
bpo-33694: Remove test_asyncio ProactorDatagramTransportTests (GH-16288)
bc2256e
miss-islington commentedon Sep 20, 2019
New changeset b50edac by Miss Islington (bot) in branch '3.8':
bpo-33694: Remove test_asyncio ProactorDatagramTransportTests (GH-16288)
b50edac