Skip to content

Commit c65e149

Browse files
committed
needed to mock the notification subsystem there
1 parent cc12cee commit c65e149

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

services/web/server/tests/unit/with_dbs/10/test_resource_manager.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# pylint:disable=redefined-outer-name
44

55

6-
from asyncio import sleep
6+
from asyncio import Future, sleep
77
from copy import deepcopy
88
from typing import Callable
99
from unittest.mock import call
@@ -425,6 +425,18 @@ async def test_interactive_services_remain_after_websocket_reconnection_from_2_t
425425
mocked_director_api["stop_service"].assert_has_calls(calls)
426426

427427

428+
@pytest.fixture
429+
async def mocked_notification_system(mocker):
430+
mocks = {}
431+
mocked_notification_system = mocker.patch(
432+
"simcore_service_webserver.projects.projects_api.retrieve_and_notify_project_locked_state",
433+
return_value=Future(),
434+
)
435+
mocked_notification_system.return_value.set_result("")
436+
mocks["mocked_notification_system"] = mocked_notification_system
437+
yield mocks
438+
439+
428440
@pytest.mark.parametrize(
429441
"user_role, exp_save_state",
430442
[
@@ -440,6 +452,7 @@ async def test_interactive_services_removed_per_project(
440452
empty_user_project2,
441453
mocked_director_api,
442454
mocked_dynamic_service,
455+
mocked_notification_system,
443456
socketio_client_factory: Callable,
444457
client_session_id_factory: Callable[[], str],
445458
asyncpg_storage_system_mock,
@@ -489,7 +502,7 @@ async def test_interactive_services_removed_per_project(
489502
# assert dynamic services are still around
490503
mocked_director_api["stop_service"].assert_not_called()
491504
# wait the defined delay
492-
await sleep(SERVICE_DELETION_DELAY + GARBAGE_COLLECTOR_INTERVAL + 2)
505+
await sleep(SERVICE_DELETION_DELAY + GARBAGE_COLLECTOR_INTERVAL + 5)
493506
# assert dynamic service 2,3 is removed
494507
calls = [
495508
call(client.server.app, service2["service_uuid"], exp_save_state),

0 commit comments

Comments
 (0)