Skip to content

Commit d446802

Browse files
authored
FIX: Give scenario end-to-end tests time to start a scenario (#2512)
1 parent 929de97 commit d446802

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/end_to_end/test_scenarios.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727

2828
CONFIG_FILE = Path(__file__).parent / "test_config.yaml"
2929

30+
#: Read timeout for the ``pyrit_scan`` client, in seconds. Starting a scenario is a single
31+
#: request that runs the initializers, resolves the target and builds the scenario before the
32+
#: server responds; loading the default datasets alone measures around three minutes on a cold
33+
#: database, and the tests share one session-scoped backend, so every scenario after the first
34+
#: re-runs that load against a table already holding the full corpus and takes considerably
35+
#: longer. The client default of 60 seconds always expires. The resulting ``ReadTimeout``
36+
#: stringifies to nothing, so the failure surfaces only as an empty "Error starting scenario:"
37+
#: message.
38+
REQUEST_TIMEOUT_SECONDS = 900
39+
3040
#: Initializers run for every scenario unless overridden in ``SCENARIO_INITIALIZERS``.
3141
#: ``target`` populates ``TargetRegistry`` from env vars; ``load_default_datasets``
3242
#: fetches each scenario's declared default datasets into memory.
@@ -91,6 +101,8 @@ def test_scenario_with_pyrit_scan(scenario_name):
91101
"openai_chat",
92102
"--config-file",
93103
str(CONFIG_FILE),
104+
"--request-timeout",
105+
str(REQUEST_TIMEOUT_SECONDS),
94106
"--max-dataset-size",
95107
"1",
96108
"--log-level",

0 commit comments

Comments
 (0)