Skip to content

Commit

Permalink
test parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Nov 26, 2024
1 parent 4b01c8d commit 1eb85e5
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
from pytest_mock import MockerFixture
from simcore_service_director_v2.models.comp_runs import RunMetadataDict
from simcore_service_director_v2.modules.comp_scheduler._manager import run_new_pipeline
from simcore_service_director_v2.modules.comp_scheduler._models import (
SchedulePipelineRabbitMessage,
)
from simcore_service_director_v2.modules.comp_scheduler._worker import (
_get_scheduler_worker,
)
Expand Down Expand Up @@ -80,12 +83,16 @@ async def mocked_scheduler_api(mocker: MockerFixture) -> mock.Mock:
)


@pytest.mark.parametrize(
"queue_name", [SchedulePipelineRabbitMessage.get_channel_name()]
)
async def test_worker_scheduling_parallelism(
with_disabled_auto_scheduling: mock.Mock,
mocked_scheduler_api: mock.Mock,
initialized_app: FastAPI,
publish_project: Callable[[], Awaitable[PublishedProject]],
run_metadata: RunMetadataDict,
ensure_parametrized_queue_is_empty: None,
):
with_disabled_auto_scheduling.assert_called_once()

Expand All @@ -94,7 +101,7 @@ async def _side_effect(*args, **kwargs):

mocked_scheduler_api.side_effect = _side_effect

async def _project_pipeline_creation_workflow():
async def _project_pipeline_creation_workflow() -> None:
published_project = await publish_project()
assert published_project.project.prj_owner
await run_new_pipeline(
Expand Down

0 comments on commit 1eb85e5

Please sign in to comment.