Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarloromeo committed Nov 22, 2024
1 parent 0ad9967 commit e3800d4
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict
from simcore_service_clusters_keeper.core.settings import ApplicationSettings

_FAST_POLL_INTERVAL = "00:00:01"


@pytest.fixture
def app_environment(
app_environment: EnvVarsDict,
monkeypatch: pytest.MonkeyPatch,
) -> EnvVarsDict:
return app_environment | setenvs_from_dict(
monkeypatch, {"CLUSTERS_KEEPER_TASK_INTERVAL": _FAST_POLL_INTERVAL}
monkeypatch, {"CLUSTERS_KEEPER_TASK_INTERVAL": "00:00:01"}
)


Expand All @@ -43,10 +41,7 @@ async def test_clusters_management_task_created_and_deleted(
initialized_app: FastAPI,
app_settings: ApplicationSettings,
):
assert (
app_settings.CLUSTERS_KEEPER_TASK_INTERVAL.total_seconds()
== _FAST_POLL_INTERVAL
)
assert app_settings.CLUSTERS_KEEPER_TASK_INTERVAL.total_seconds() == 1
assert hasattr(initialized_app.state, "clusters_cleaning_task")
await asyncio.sleep(5 * _FAST_POLL_INTERVAL)
await asyncio.sleep(5)
mock_background_task.assert_called()

0 comments on commit e3800d4

Please sign in to comment.