diff --git a/tests/integration/test_runs_api.py b/tests/integration/test_runs_api.py index 48afd61..95ecac4 100644 --- a/tests/integration/test_runs_api.py +++ b/tests/integration/test_runs_api.py @@ -135,13 +135,15 @@ async def test_start_run_then_get(client, seeded_db, mock_channel): async def test_cancel_run(client, seeded_db, mock_channel): # Seed a multi-case scenario so the run takes long enough to cancel. + # Cases run 3-concurrent, so 30 cases ≈ 10 waves × reply_delay — comfortably + # longer than the pre-cancel window below. from agenteval.models import Case, CaseType, Scenario from agenteval.storage.repository import ScenarioRepository multi = Scenario( id="s-long", name="long-scenario", cases=[ Case(id=f"lc{i}", type=CaseType.SINGLE, messages=[f"m{i}"]) - for i in range(5) + for i in range(30) ], ) ScenarioRepository(seeded_db).create(multi) @@ -170,8 +172,8 @@ async def test_cancel_run(client, seeded_db, mock_channel): final = (await client.get(f"/api/runs/{run_id}")).json() assert final["status"] == "failed" assert final["summary"]["error"]["code"] == "cancelled_by_user" - # Not all 5 cases should have run. - assert mock_channel.send_calls < 5 + # Not all 30 cases should have run. + assert mock_channel.send_calls < 30 async def test_get_run_logs(client, seeded_db, mock_channel):