testing._run_test
(internal) Run a single test with error handling and optional runner middleware. Every test races against a `timeout_ms` deadline (a non-positive value means no deadline, so no timer is spawned; the CLI defaults it to 5 minutes and `--test-timeout` overrides): a hung test — a stalled network read, a deadlocked await — becomes a FAIL with a "timed out" message instead of hanging the whole run. `baml.future.race` cancels the losers when one side settles (BEP-034), so a timed-out body is actively cancelled and a finished test's leftover timer doesn't linger.
Signature
(internal) Run a single test with error handling and optional runner middleware.
Every test races against a timeout_ms deadline (a non-positive value
means no deadline, so no timer is spawned; the CLI defaults it to 5
minutes and --test-timeout overrides): a hung test — a stalled network read, a
deadlocked await — becomes a FAIL with a "timed out" message instead of
hanging the whole run. baml.future.race cancels the losers when one
side settles (BEP-034), so a timed-out body is actively cancelled and a
finished test's leftover timer doesn't linger.
Source:<builtin>/testing/registry.bamlbytes 20854–24602