Skip to content

Commit 02c182d

Browse files
committed
fixed tests?
1 parent 21b5d9a commit 02c182d

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.github/workflows/ci-testing-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ jobs:
514514
unit-test-storage:
515515
needs: changes
516516
if: ${{ needs.changes.outputs.storage == 'true' || github.event_name == 'push' }}
517-
timeout-minutes: 18 # if this timeout gets too small, then split the tests
517+
timeout-minutes: 25 # if this timeout gets too small, then split the tests
518518
name: "[unit] storage"
519519
runs-on: ${{ matrix.os }}
520520
strategy:

services/web/server/tests/unit/with_dbs/02/test_projects_cancellations.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
import pytest
1313
from aiohttp.test_utils import TestClient
14+
from faker import Faker
15+
from models_library.api_schemas_rpc_async_jobs.async_jobs import AsyncJobStatus
16+
from models_library.progress_bar import ProgressReport
1417
from pydantic import ByteSize, TypeAdapter
1518
from pytest_simcore.helpers.assert_checks import assert_status
1619
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
@@ -20,8 +23,10 @@
2023
MockedStorageSubsystem,
2124
standard_role_response,
2225
)
23-
from servicelib.aiohttp.long_running_tasks.client import LRTask
24-
from servicelib.aiohttp.long_running_tasks.server import TaskGet, TaskProgress
26+
from servicelib.aiohttp.long_running_tasks.server import TaskGet
27+
from servicelib.rabbitmq.rpc_interfaces.async_jobs.async_jobs import (
28+
AsyncJobComposedResult,
29+
)
2530
from simcore_postgres_database.models.users import UserRole
2631
from simcore_service_webserver._meta import api_version_prefix
2732
from simcore_service_webserver.application_settings import get_application_settings
@@ -46,16 +51,22 @@ def app_environment(
4651

4752
@pytest.fixture
4853
async def slow_storage_subsystem_mock(
49-
storage_subsystem_mock: MockedStorageSubsystem,
54+
storage_subsystem_mock: MockedStorageSubsystem, faker: Faker
5055
) -> MockedStorageSubsystem:
5156
# requests storage to copy data
5257
async def _very_slow_copy_of_data(*args):
5358
await asyncio.sleep(30)
5459

55-
async def _mock_result():
56-
...
60+
async def _mock_result(): ...
5761

58-
yield LRTask(progress=TaskProgress(), _result=_mock_result())
62+
yield AsyncJobComposedResult(
63+
AsyncJobStatus(
64+
job_id=faker.uuid4(cast_to=None),
65+
progress=ProgressReport(actual_value=1),
66+
done=True,
67+
),
68+
_mock_result(),
69+
)
5970

6071
storage_subsystem_mock.copy_data_folders_from_project.side_effect = (
6172
_very_slow_copy_of_data

0 commit comments

Comments
 (0)