Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Nov 18, 2024
1 parent fb93813 commit e4c3e8d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import asyncio
import contextlib
import logging
from collections.abc import AsyncIterator
from collections.abc import AsyncIterator, Callable
from contextlib import asynccontextmanager
from dataclasses import dataclass
from typing import Callable

import arrow
from dask_task_models_library.container_tasks.errors import TaskCancelledError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from ..db import get_db_engine
from ..rabbitmq import get_rabbitmq_client, get_rabbitmq_rpc_client
from ..redis import get_redis_client_manager
from ._dask_scheduler import DaskScheduler
from ._scheduler_base import BaseCompScheduler
from ._scheduler_dask import DaskScheduler

_logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
BaseCompScheduler,
_get_scheduler_worker,
)
from simcore_service_director_v2.modules.comp_scheduler._dask_scheduler import (
from simcore_service_director_v2.modules.comp_scheduler._scheduler_dask import (
DaskScheduler,
)
from simcore_service_director_v2.modules.dask_client import (
Expand Down Expand Up @@ -192,7 +192,7 @@ async def schedule_all_pipelines(scheduler: BaseCompScheduler) -> None:


@pytest.fixture
def minimal_dask_scheduler_config(
def minimal_scheduler_dask_config(
mock_env: EnvVarsDict,
postgres_host_config: dict[str, str],
monkeypatch: pytest.MonkeyPatch,
Expand All @@ -215,7 +215,7 @@ def minimal_dask_scheduler_config(

@pytest.fixture
def scheduler(
minimal_dask_scheduler_config: None,
minimal_scheduler_dask_config: None,
aiopg_engine: aiopg.sa.engine.Engine,
minimal_app: FastAPI,
) -> BaseCompScheduler:
Expand All @@ -237,15 +237,15 @@ def mocked_dask_client(mocker: MockerFixture) -> mock.MagicMock:
@pytest.fixture
def mocked_parse_output_data_fct(mocker: MockerFixture) -> mock.Mock:
return mocker.patch(
"simcore_service_director_v2.modules.comp_scheduler._dask_scheduler.parse_output_data",
"simcore_service_director_v2.modules.comp_scheduler._scheduler_dask.parse_output_data",
autospec=True,
)


@pytest.fixture
def mocked_clean_task_output_fct(mocker: MockerFixture) -> mock.MagicMock:
return mocker.patch(
"simcore_service_director_v2.modules.comp_scheduler._dask_scheduler.clean_task_output_and_log_files_if_invalid",
"simcore_service_director_v2.modules.comp_scheduler._scheduler_dask.clean_task_output_and_log_files_if_invalid",
return_value=None,
autospec=True,
)
Expand Down Expand Up @@ -284,13 +284,13 @@ async def minimal_app(async_client: httpx.AsyncClient) -> FastAPI:
@pytest.fixture
def mocked_clean_task_output_and_log_files_if_invalid(mocker: MockerFixture) -> None:
mocker.patch(
"simcore_service_director_v2.modules.comp_scheduler._dask_scheduler.clean_task_output_and_log_files_if_invalid",
"simcore_service_director_v2.modules.comp_scheduler._scheduler_dask.clean_task_output_and_log_files_if_invalid",
autospec=True,
)


async def test_scheduler_gracefully_starts_and_stops(
minimal_dask_scheduler_config: None,
minimal_scheduler_dask_config: None,
aiopg_engine: aiopg.sa.engine.Engine,
dask_spec_local_cluster: SpecCluster,
minimal_app: FastAPI,
Expand All @@ -306,7 +306,7 @@ async def test_scheduler_gracefully_starts_and_stops(
],
)
def test_scheduler_raises_exception_for_missing_dependencies(
minimal_dask_scheduler_config: None,
minimal_scheduler_dask_config: None,
aiopg_engine: aiopg.sa.engine.Engine,
dask_spec_local_cluster: SpecCluster,
monkeypatch: pytest.MonkeyPatch,
Expand Down Expand Up @@ -1090,7 +1090,7 @@ async def test_task_progress_triggers(
),
],
)
async def test_handling_of_disconnected_dask_scheduler(
async def test_handling_of_disconnected_scheduler_dask(
with_disabled_auto_scheduling: None,
mocked_dask_client: mock.MagicMock,
scheduler: BaseCompScheduler,
Expand All @@ -1102,7 +1102,7 @@ async def test_handling_of_disconnected_dask_scheduler(
):
# this will create a non connected backend issue that will trigger re-connection
mocked_dask_client_send_task = mocker.patch(
"simcore_service_director_v2.modules.comp_scheduler._dask_scheduler.DaskClient.send_computation_tasks",
"simcore_service_director_v2.modules.comp_scheduler._scheduler_dask.DaskClient.send_computation_tasks",
side_effect=backend_error,
)
assert mocked_dask_client_send_task
Expand Down Expand Up @@ -1493,7 +1493,7 @@ async def _return_1st_task_running(job_ids: list[str]) -> list[DaskClientTaskSta
@pytest.fixture
async def mocked_get_or_create_cluster(mocker: MockerFixture) -> mock.Mock:
return mocker.patch(
"simcore_service_director_v2.modules.comp_scheduler._dask_scheduler.get_or_create_on_demand_cluster",
"simcore_service_director_v2.modules.comp_scheduler._scheduler_dask.get_or_create_on_demand_cluster",
autospec=True,
)

Expand Down

0 comments on commit e4c3e8d

Please sign in to comment.