@@ -15,13 +15,12 @@ def test_spawning_external_process(self):
15
15
cause loop freeze."""
16
16
17
17
async def run (loop ):
18
- event = asyncio .Event (loop = loop )
18
+ event = asyncio .Event ()
19
19
20
20
dummy_workers = [simulate_loop_activity (loop , event )
21
21
for _ in range (5 )]
22
22
spawn_worker = spawn_external_process (loop , event )
23
- done , pending = await asyncio .wait ([spawn_worker ] + dummy_workers ,
24
- loop = loop )
23
+ done , pending = await asyncio .wait ([spawn_worker ] + dummy_workers )
25
24
exceptions = [result .exception ()
26
25
for result in done if result .exception ()]
27
26
if exceptions :
@@ -33,8 +32,7 @@ async def simulate_loop_activity(loop, done_event):
33
32
"""Simulate loop activity by busy waiting for event."""
34
33
while True :
35
34
try :
36
- await asyncio .wait_for (done_event .wait (),
37
- timeout = 0.1 , loop = loop )
35
+ await asyncio .wait_for (done_event .wait (), timeout = 0.1 )
38
36
except asyncio .TimeoutError :
39
37
pass
40
38
@@ -45,7 +43,7 @@ async def spawn_external_process(loop, event):
45
43
executor = ThreadPoolExecutor ()
46
44
try :
47
45
call = loop .run_in_executor (executor , spawn_process )
48
- await asyncio .wait_for (call , loop = loop , timeout = 3600 )
46
+ await asyncio .wait_for (call , timeout = 3600 )
49
47
finally :
50
48
event .set ()
51
49
executor .shutdown (wait = False )
0 commit comments