Skip to content

Commit 1a9fe6b

Browse files
committed
renaming
1 parent 5e9cf33 commit 1a9fe6b

File tree

2 files changed

+15
-15
lines changed
  • services/director-v2

2 files changed

+15
-15
lines changed

services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async def _get_pipeline_dag(project_id: ProjectID, db_engine: Engine) -> nx.DiGr
115115
get_redis_client_from_app,
116116
lock_key=get_redis_lock_key(MODULE_NAME_SCHEDULER, unique_lock_key_builder=None),
117117
)
118-
async def schedule_pipelines(app: FastAPI) -> None:
118+
async def schedule_all_pipelines(app: FastAPI) -> None:
119119
with log_context(_logger, logging.DEBUG, msg="scheduling pipelines"):
120120
db_engine = get_db_engine(app)
121121
runs_to_schedule = await CompRunsRepository.instance(db_engine).list(
@@ -142,7 +142,7 @@ async def schedule_pipelines(app: FastAPI) -> None:
142142

143143
async def setup_manager(app: FastAPI) -> None:
144144
app.state.scheduler_manager = start_periodic_task(
145-
schedule_pipelines,
145+
schedule_all_pipelines,
146146
interval=SCHEDULER_INTERVAL,
147147
task_name=MODULE_NAME_SCHEDULER,
148148
app=app,

services/director-v2/tests/unit/with_dbs/comp_scheduler/test_manager.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from simcore_service_director_v2.modules.comp_scheduler._manager import (
3232
SCHEDULER_INTERVAL,
3333
run_new_pipeline,
34-
schedule_pipelines,
34+
schedule_all_pipelines,
3535
stop_pipeline,
3636
)
3737
from simcore_service_director_v2.modules.comp_scheduler._models import (
@@ -66,25 +66,25 @@ def with_fast_scheduling(mocker: MockerFixture) -> None:
6666

6767

6868
@pytest.fixture
69-
def mocked_schedule_pipelines(mocker: MockerFixture) -> mock.Mock:
69+
def mocked_schedule_all_pipelines(mocker: MockerFixture) -> mock.Mock:
7070
return mocker.patch(
71-
"simcore_service_director_v2.modules.comp_scheduler._manager.schedule_pipelines",
71+
"simcore_service_director_v2.modules.comp_scheduler._manager.schedule_all_pipelines",
7272
autospec=True,
7373
)
7474

7575

7676
async def test_manager_starts_and_auto_schedules_pipelines(
7777
with_fast_scheduling: None,
7878
with_disabled_scheduler_worker: mock.Mock,
79-
mocked_schedule_pipelines: mock.Mock,
79+
mocked_schedule_all_pipelines: mock.Mock,
8080
initialized_app: FastAPI,
8181
sqlalchemy_async_engine: AsyncEngine,
8282
):
8383
await assert_comp_runs_empty(sqlalchemy_async_engine)
84-
mocked_schedule_pipelines.assert_called()
84+
mocked_schedule_all_pipelines.assert_called()
8585

8686

87-
async def test_schedule_pipelines_empty_db(
87+
async def test_schedule_all_pipelines_empty_db(
8888
with_disabled_auto_scheduling: mock.Mock,
8989
with_disabled_scheduler_worker: mock.Mock,
9090
initialized_app: FastAPI,
@@ -93,7 +93,7 @@ async def test_schedule_pipelines_empty_db(
9393
):
9494
await assert_comp_runs_empty(sqlalchemy_async_engine)
9595

96-
await schedule_pipelines(initialized_app)
96+
await schedule_all_pipelines(initialized_app)
9797

9898
# check nothing was distributed
9999
scheduler_rabbit_client_parser.assert_not_called()
@@ -102,7 +102,7 @@ async def test_schedule_pipelines_empty_db(
102102
await assert_comp_runs_empty(sqlalchemy_async_engine)
103103

104104

105-
async def test_schedule_pipelines_concurently_runs_exclusively_and_raises(
105+
async def test_schedule_all_pipelines_concurently_runs_exclusively_and_raises(
106106
with_disabled_auto_scheduling: mock.Mock,
107107
initialized_app: FastAPI,
108108
mocker: MockerFixture,
@@ -124,7 +124,7 @@ async def slow_limited_gather(*args, **kwargs):
124124
)
125125

126126
results = await asyncio.gather(
127-
*(schedule_pipelines(initialized_app) for _ in range(CONCURRENCY)),
127+
*(schedule_all_pipelines(initialized_app) for _ in range(CONCURRENCY)),
128128
return_exceptions=True,
129129
)
130130

@@ -135,7 +135,7 @@ async def slow_limited_gather(*args, **kwargs):
135135
mock_function.assert_called_once()
136136

137137

138-
async def test_schedule_pipelines(
138+
async def test_schedule_all_pipelines(
139139
with_disabled_auto_scheduling: mock.Mock,
140140
with_disabled_scheduler_worker: mock.Mock,
141141
initialized_app: FastAPI,
@@ -178,7 +178,7 @@ async def test_schedule_pipelines(
178178
start_modified_time = comp_run.modified
179179

180180
# this will now not schedule the pipeline since it was last scheduled
181-
await schedule_pipelines(initialized_app)
181+
await schedule_all_pipelines(initialized_app)
182182
scheduler_rabbit_client_parser.assert_not_called()
183183
comp_runs = await assert_comp_runs(sqlalchemy_async_engine, expected_total=1)
184184
comp_run = comp_runs[0]
@@ -188,7 +188,7 @@ async def test_schedule_pipelines(
188188

189189
# this will now schedule the pipeline since the time passed
190190
await asyncio.sleep(SCHEDULER_INTERVAL.total_seconds() + 1)
191-
await schedule_pipelines(initialized_app)
191+
await schedule_all_pipelines(initialized_app)
192192
scheduler_rabbit_client_parser.assert_called_once_with(
193193
SchedulePipelineRabbitMessage(
194194
user_id=published_project.project.prj_owner,
@@ -211,7 +211,7 @@ async def test_schedule_pipelines(
211211
user_id=published_project.project.prj_owner,
212212
project_id=published_project.project.uuid,
213213
)
214-
await schedule_pipelines(initialized_app)
214+
await schedule_all_pipelines(initialized_app)
215215
scheduler_rabbit_client_parser.assert_called_once_with(
216216
SchedulePipelineRabbitMessage(
217217
user_id=published_project.project.prj_owner,

0 commit comments

Comments
 (0)