4646from models_library .projects_nodes_io import NodeID
4747from models_library .resource_tracker import HardwareInfo
4848from models_library .users import UserID
49- from pydantic import AnyUrl , ByteSize , PositiveInt , TypeAdapter
49+ from pydantic import AnyUrl , ByteSize , TypeAdapter
5050from pytest_mock .plugin import MockerFixture
5151from pytest_simcore .helpers .typing_env import EnvVarsDict
5252from settings_library .s3 import S3Settings
@@ -442,7 +442,7 @@ async def test_send_computation_task(
442442 task_labels : ContainerLabelsDict ,
443443 empty_hardware_info : HardwareInfo ,
444444 faker : Faker ,
445- comp_task_run_id : PositiveInt ,
445+ resource_tracking_run_id : str ,
446446):
447447 _DASK_EVENT_NAME = faker .pystr ()
448448
@@ -504,7 +504,7 @@ def fake_sidecar_fct(
504504 ),
505505 metadata = comp_run_metadata ,
506506 hardware_info = empty_hardware_info ,
507- run_id = comp_task_run_id ,
507+ resource_tracking_run_id = resource_tracking_run_id ,
508508 )
509509 assert node_id_to_job_ids
510510 assert len (node_id_to_job_ids ) == 1
@@ -561,7 +561,7 @@ async def test_computation_task_is_persisted_on_dask_scheduler(
561561 mocked_storage_service_api : respx .MockRouter ,
562562 comp_run_metadata : RunMetadataDict ,
563563 empty_hardware_info : HardwareInfo ,
564- comp_task_run_id : PositiveInt ,
564+ resource_tracking_run_id : str ,
565565):
566566 """rationale:
567567 When a task is submitted to the dask backend, a dask future is returned.
@@ -597,7 +597,7 @@ def fake_sidecar_fct(
597597 remote_fct = fake_sidecar_fct ,
598598 metadata = comp_run_metadata ,
599599 hardware_info = empty_hardware_info ,
600- run_id = comp_task_run_id ,
600+ resource_tracking_run_id = resource_tracking_run_id ,
601601 )
602602 assert published_computation_task
603603 assert len (published_computation_task ) == 1
@@ -653,7 +653,7 @@ async def test_abort_computation_tasks(
653653 faker : Faker ,
654654 comp_run_metadata : RunMetadataDict ,
655655 empty_hardware_info : HardwareInfo ,
656- comp_task_run_id : PositiveInt ,
656+ resource_tracking_run_id : str ,
657657):
658658 _DASK_EVENT_NAME = faker .pystr ()
659659
@@ -692,7 +692,7 @@ def fake_remote_fct(
692692 remote_fct = fake_remote_fct ,
693693 metadata = comp_run_metadata ,
694694 hardware_info = empty_hardware_info ,
695- run_id = comp_task_run_id ,
695+ resource_tracking_run_id = resource_tracking_run_id ,
696696 )
697697 assert published_computation_task
698698 assert len (published_computation_task ) == 1
@@ -744,7 +744,7 @@ async def test_failed_task_returns_exceptions(
744744 mocked_storage_service_api : respx .MockRouter ,
745745 comp_run_metadata : RunMetadataDict ,
746746 empty_hardware_info : HardwareInfo ,
747- comp_task_run_id : PositiveInt ,
747+ resource_tracking_run_id : str ,
748748):
749749 # NOTE: this must be inlined so that the test works,
750750 # the dask-worker must be able to import the function
@@ -765,7 +765,7 @@ def fake_failing_sidecar_fct(
765765 remote_fct = fake_failing_sidecar_fct ,
766766 metadata = comp_run_metadata ,
767767 hardware_info = empty_hardware_info ,
768- run_id = comp_task_run_id ,
768+ resource_tracking_run_id = resource_tracking_run_id ,
769769 )
770770 assert published_computation_task
771771 assert len (published_computation_task ) == 1
@@ -808,7 +808,7 @@ async def test_send_computation_task_with_missing_resources_raises(
808808 mocked_storage_service_api : respx .MockRouter ,
809809 comp_run_metadata : RunMetadataDict ,
810810 empty_hardware_info : HardwareInfo ,
811- comp_task_run_id : PositiveInt ,
811+ resource_tracking_run_id : str ,
812812):
813813 # remove the workers that can handle gpu
814814 scheduler_info = dask_client .backend .client .scheduler_info ()
@@ -835,7 +835,7 @@ async def test_send_computation_task_with_missing_resources_raises(
835835 remote_fct = None ,
836836 metadata = comp_run_metadata ,
837837 hardware_info = empty_hardware_info ,
838- run_id = comp_task_run_id ,
838+ resource_tracking_run_id = resource_tracking_run_id ,
839839 )
840840 mocked_user_completed_cb .assert_not_called ()
841841
@@ -854,7 +854,7 @@ async def test_send_computation_task_with_hardware_info_raises(
854854 mocked_storage_service_api : respx .MockRouter ,
855855 comp_run_metadata : RunMetadataDict ,
856856 hardware_info : HardwareInfo ,
857- comp_task_run_id : PositiveInt ,
857+ resource_tracking_run_id : str ,
858858):
859859 # NOTE: running on the default cluster will raise missing resources
860860 with pytest .raises (MissingComputationalResourcesError ):
@@ -866,7 +866,7 @@ async def test_send_computation_task_with_hardware_info_raises(
866866 remote_fct = None ,
867867 metadata = comp_run_metadata ,
868868 hardware_info = hardware_info ,
869- run_id = comp_task_run_id ,
869+ resource_tracking_run_id = resource_tracking_run_id ,
870870 )
871871 mocked_user_completed_cb .assert_not_called ()
872872
@@ -884,7 +884,7 @@ async def test_too_many_resources_send_computation_task(
884884 mocked_storage_service_api : respx .MockRouter ,
885885 comp_run_metadata : RunMetadataDict ,
886886 empty_hardware_info : HardwareInfo ,
887- comp_task_run_id : PositiveInt ,
887+ resource_tracking_run_id : str ,
888888):
889889 # create an image that needs a huge amount of CPU
890890 image = Image (
@@ -908,7 +908,7 @@ async def test_too_many_resources_send_computation_task(
908908 remote_fct = None ,
909909 metadata = comp_run_metadata ,
910910 hardware_info = empty_hardware_info ,
911- run_id = comp_task_run_id ,
911+ resource_tracking_run_id = resource_tracking_run_id ,
912912 )
913913
914914 mocked_user_completed_cb .assert_not_called ()
@@ -925,7 +925,7 @@ async def test_disconnected_backend_raises_exception(
925925 mocked_storage_service_api : respx .MockRouter ,
926926 comp_run_metadata : RunMetadataDict ,
927927 empty_hardware_info : HardwareInfo ,
928- comp_task_run_id : PositiveInt ,
928+ resource_tracking_run_id : str ,
929929):
930930 # DISCONNECT THE CLUSTER
931931 await dask_spec_local_cluster .close () # type: ignore
@@ -938,7 +938,7 @@ async def test_disconnected_backend_raises_exception(
938938 remote_fct = None ,
939939 metadata = comp_run_metadata ,
940940 hardware_info = empty_hardware_info ,
941- run_id = comp_task_run_id ,
941+ resource_tracking_run_id = resource_tracking_run_id ,
942942 )
943943 mocked_user_completed_cb .assert_not_called ()
944944
@@ -958,7 +958,7 @@ async def test_changed_scheduler_raises_exception(
958958 unused_tcp_port_factory : Callable ,
959959 comp_run_metadata : RunMetadataDict ,
960960 empty_hardware_info : HardwareInfo ,
961- comp_task_run_id : PositiveInt ,
961+ resource_tracking_run_id : str ,
962962):
963963 # change the scheduler (stop the current one and start another at the same address)
964964 scheduler_address = URL (dask_spec_local_cluster .scheduler_address )
@@ -988,7 +988,7 @@ async def test_changed_scheduler_raises_exception(
988988 remote_fct = None ,
989989 metadata = comp_run_metadata ,
990990 hardware_info = empty_hardware_info ,
991- run_id = comp_task_run_id ,
991+ resource_tracking_run_id = resource_tracking_run_id ,
992992 )
993993 mocked_user_completed_cb .assert_not_called ()
994994
@@ -1006,7 +1006,7 @@ async def test_get_tasks_status(
10061006 fail_remote_fct : bool ,
10071007 comp_run_metadata : RunMetadataDict ,
10081008 empty_hardware_info : HardwareInfo ,
1009- comp_task_run_id : PositiveInt ,
1009+ resource_tracking_run_id : str ,
10101010):
10111011 # NOTE: this must be inlined so that the test works,
10121012 # the dask-worker must be able to import the function
@@ -1034,7 +1034,7 @@ def fake_remote_fct(
10341034 remote_fct = fake_remote_fct ,
10351035 metadata = comp_run_metadata ,
10361036 hardware_info = empty_hardware_info ,
1037- run_id = comp_task_run_id ,
1037+ resource_tracking_run_id = resource_tracking_run_id ,
10381038 )
10391039 assert published_computation_task
10401040 assert len (published_computation_task ) == 1
@@ -1089,7 +1089,7 @@ async def test_dask_sub_handlers(
10891089 fake_task_handlers : TaskHandlers ,
10901090 comp_run_metadata : RunMetadataDict ,
10911091 empty_hardware_info : HardwareInfo ,
1092- comp_task_run_id : PositiveInt ,
1092+ resource_tracking_run_id : str ,
10931093):
10941094 dask_client .register_handlers (fake_task_handlers )
10951095 _DASK_START_EVENT = "start"
@@ -1119,7 +1119,7 @@ def fake_remote_fct(
11191119 remote_fct = fake_remote_fct ,
11201120 metadata = comp_run_metadata ,
11211121 hardware_info = empty_hardware_info ,
1122- run_id = comp_task_run_id ,
1122+ resource_tracking_run_id = resource_tracking_run_id ,
11231123 )
11241124 assert published_computation_task
11251125 assert len (published_computation_task ) == 1
@@ -1164,7 +1164,7 @@ async def test_get_cluster_details(
11641164 comp_run_metadata : RunMetadataDict ,
11651165 empty_hardware_info : HardwareInfo ,
11661166 faker : Faker ,
1167- comp_task_run_id : PositiveInt ,
1167+ resource_tracking_run_id : str ,
11681168):
11691169 cluster_details = await dask_client .get_cluster_details ()
11701170 assert cluster_details
@@ -1201,7 +1201,7 @@ def fake_sidecar_fct(
12011201 ),
12021202 metadata = comp_run_metadata ,
12031203 hardware_info = empty_hardware_info ,
1204- run_id = comp_task_run_id ,
1204+ resource_tracking_run_id = resource_tracking_run_id ,
12051205 )
12061206 assert published_computation_task
12071207 assert len (published_computation_task ) == 1
0 commit comments