File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from unittest import mock
88
99
10- class SelectorThreadTest (( unittest .IsolatedAsyncioTestCase ) ):
10+ class SelectorThreadTest (unittest .IsolatedAsyncioTestCase ):
1111 async def asyncSetUp (self ):
1212 self ._sockets = []
1313 self .selector_thread = SelectorThread (asyncio .get_running_loop ())
@@ -39,7 +39,7 @@ def recv():
3939 self .selector_thread .add_reader (b , mock_recv )
4040 # ready event, but main event loop is blocked for some time
4141 time .sleep (0.1 )
42- recvd = await asyncio .wait_for (first_recv , timeout = 10 )
42+ recvd = await asyncio .wait_for (first_recv , timeout = support . SHORT_TIMEOUT )
4343 self .assertEqual (recvd , b"msg" )
4444 # make sure recv wasn't scheduled more than once
4545 self .assertEqual (mock_recv .call_count , 1 )
@@ -84,7 +84,7 @@ def bad_recv(sock):
8484 with mock .patch .object (
8585 selector_thread , "_start_select" , wraps = selector_thread ._start_select
8686 ) as start_select :
87- await asyncio .wait_for (bad_recv_done , timeout = 10 )
87+ await asyncio .wait_for (bad_recv_done , timeout = support . SHORT_TIMEOUT )
8888
8989 # make sure recv is called N + 1 times,
9090 # exception N times,
Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ def read():
363363 self .loop .add_writer (a , write )
364364 self .assertIs (self .loop ._selector_thread , _selector_thread )
365365 self .assertIn (a .fileno (), _selector_thread ._writers )
366- msg = await asyncio .wait_for (read_future , timeout = 10 )
366+ msg = await asyncio .wait_for (read_future , timeout = support . SHORT_TIMEOUT )
367367
368368 self .loop .remove_writer (a )
369369 self .assertNotIn (a .fileno (), _selector_thread ._writers )
You can’t perform that action at this time.
0 commit comments