import asyncio import pytest from monitor_service.models import MonitorCreate from monitor_service.store import MonitorStore @pytest.mark.anyio async def test_concurrent_creates_are_not_lost() -> None: store = MonitorStore() await asyncio.gather(*( store.create(MonitorCreate(name=f"m-{index}", url=f"https://example.com/{index}")) for index in range(30) )) assert len(await store.list()) == 30