Skip to content

Commit 1168c77

Browse files
🎨 add WAITING_FOR_RESOURCES to get_pipeline_state_from_task_states (#7640)
1 parent 4bd14ca commit 1168c77

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

services/director-v2/src/simcore_service_director_v2/utils/computations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
RunningState.NOT_STARTED,
2727
RunningState.WAITING_FOR_CLUSTER,
2828
): RunningState.WAITING_FOR_CLUSTER,
29+
# if there are tasks waiting for resources and nothing is running/pending, then the pipeline is also waiting for resources
30+
(
31+
RunningState.PUBLISHED,
32+
RunningState.NOT_STARTED,
33+
RunningState.WAITING_FOR_RESOURCES,
34+
): RunningState.WAITING_FOR_RESOURCES,
2935
# if there are PENDING states that means the pipeline was published and is awaiting sidecars
3036
(
3137
RunningState.PENDING,

services/director-v2/tests/unit/test_utils_computation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ def fake_task(fake_task_file: Path) -> CompTaskAtDB:
257257
RunningState.WAITING_FOR_CLUSTER,
258258
id="published and waiting for cluster = waiting for cluster",
259259
),
260+
pytest.param(
261+
[
262+
(RunningState.WAITING_FOR_RESOURCES),
263+
(RunningState.PUBLISHED),
264+
(RunningState.PUBLISHED),
265+
],
266+
RunningState.WAITING_FOR_RESOURCES,
267+
id="published and waiting for resources = waiting for resources",
268+
),
260269
],
261270
)
262271
def test_get_pipeline_state_from_task_states(

0 commit comments

Comments
 (0)