File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -351,6 +351,7 @@ async def _unroute_promise() -> None:
351351async def test_page_close_does_not_wait_for_active_route_handlers (
352352 page : Page , server : Server
353353) -> None :
354+ stalling_future : "asyncio.Future[None]" = asyncio .Future ()
354355 second_handler_called = False
355356
356357 def _handler1 (route : Route ) -> None :
@@ -365,7 +366,7 @@ def _handler1(route: Route) -> None:
365366
366367 async def _handler2 (route : Route ) -> None :
367368 route_future .set_result (route )
368- await asyncio . Future ()
369+ await stalling_future
369370
370371 await page .route (
371372 "**/*" ,
@@ -383,6 +384,7 @@ async def _goto_ignore_exceptions() -> None:
383384 await page .close ()
384385 await asyncio .sleep (0.5 )
385386 assert not second_handler_called
387+ stalling_future .cancel ()
386388
387389
388390async def test_route_continue_should_not_throw_if_page_has_been_closed (
You can’t perform that action at this time.
0 commit comments