File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828CONFIG_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" ,
You can’t perform that action at this time.
0 commit comments