File tree 1 file changed +3
-1
lines changed 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ async def _unroute_promise() -> None:
351
351
async def test_page_close_does_not_wait_for_active_route_handlers (
352
352
page : Page , server : Server
353
353
) -> None :
354
+ stalling_future : "asyncio.Future[None]" = asyncio .Future ()
354
355
second_handler_called = False
355
356
356
357
def _handler1 (route : Route ) -> None :
@@ -365,7 +366,7 @@ def _handler1(route: Route) -> None:
365
366
366
367
async def _handler2 (route : Route ) -> None :
367
368
route_future .set_result (route )
368
- await asyncio . Future ()
369
+ await stalling_future
369
370
370
371
await page .route (
371
372
"**/*" ,
@@ -383,6 +384,7 @@ async def _goto_ignore_exceptions() -> None:
383
384
await page .close ()
384
385
await asyncio .sleep (0.5 )
385
386
assert not second_handler_called
387
+ stalling_future .cancel ()
386
388
387
389
388
390
async def test_route_continue_should_not_throw_if_page_has_been_closed (
You can’t perform that action at this time.
0 commit comments