@@ -116,7 +116,7 @@ async def _assert_handler_called_with_json(
116116) -> None :
117117 async for attempt in AsyncRetrying (
118118 wait = wait_fixed (0.2 ),
119- stop = stop_after_delay (10 ),
119+ stop = stop_after_delay (1000 ),
120120 retry = retry_if_exception_type (AssertionError ),
121121 reraise = True ,
122122 ):
@@ -370,6 +370,45 @@ async def test_progress_non_computational_workflow(
370370 await _assert_handler_not_called (mock_progress_handler )
371371
372372
373+ @pytest .fixture
374+ def mock_dynamic_scheduler (mocker : MockerFixture ) -> None :
375+ mocker .patch (
376+ "simcore_service_webserver.dynamic_scheduler.api.stop_dynamic_services_in_project" ,
377+ autospec = True ,
378+ )
379+ mocker .patch (
380+ "simcore_service_webserver.dynamic_scheduler.api.update_projects_networks" ,
381+ autospec = True ,
382+ )
383+
384+
385+ @pytest .fixture
386+ async def mocked_dynamic_services_interface (
387+ mocker : MockerFixture ,
388+ ) -> dict [str , mock .MagicMock ]:
389+ mock = {}
390+
391+ for func_name in (
392+ "list_dynamic_services" ,
393+ "get_dynamic_service" ,
394+ "run_dynamic_service" ,
395+ "stop_dynamic_service" ,
396+ ):
397+ name = f"dynamic_scheduler.api.{ func_name } "
398+ mock [name ] = mocker .patch (
399+ f"simcore_service_webserver.{ name } " ,
400+ autospec = True ,
401+ return_value = {},
402+ )
403+
404+ mock ["director_v2.api.create_or_update_pipeline" ] = mocker .patch (
405+ "simcore_service_webserver.director_v2.director_v2_service.create_or_update_pipeline" ,
406+ autospec = True ,
407+ return_value = None ,
408+ )
409+ return mock
410+
411+
373412@pytest .mark .parametrize ("user_role" , [UserRole .GUEST ], ids = str )
374413@pytest .mark .parametrize (
375414 "sender_same_user_id" , [True , False ], ids = lambda id_ : f"same_sender_id={ id_ } "
@@ -378,6 +417,8 @@ async def test_progress_non_computational_workflow(
378417 "subscribe_to_logs" , [True , False ], ids = lambda id_ : f"subscribed={ id_ } "
379418)
380419async def test_progress_computational_workflow (
420+ mock_dynamic_scheduler : None ,
421+ mocked_dynamic_services_interface : dict [str , mock .MagicMock ],
381422 client : TestClient ,
382423 rabbitmq_publisher : RabbitMQClient ,
383424 user_project : ProjectDict ,
0 commit comments