Skip to content
Latchkey

schemathesis "hypothesis DeadlineExceeded" in CI

schemathesis runs on top of Hypothesis, which fails an example that exceeds a per-test deadline (200ms by default). A slow endpoint or a cold CI runner can trip this even when the response is correct.

What this error means

schemathesis reports a failure with "hypothesis.errors.DeadlineExceeded: Test took T ms, which exceeds the deadline of 200.00ms" for an otherwise valid endpoint.

schemathesis
hypothesis.errors.DeadlineExceeded: Test took 512.44ms, which exceeds
the deadline of 200.00ms

Common causes

The endpoint is genuinely slow in CI

A cold runner, an unwarmed cache, or a heavy handler makes a single request exceed the 200ms Hypothesis deadline even though it succeeds.

The default deadline is too tight for integration tests

Hypothesis deadlines suit fast unit properties; real HTTP round-trips in CI often exceed 200ms without any real problem.

How to fix it

Raise or disable the Hypothesis deadline

Pass a larger deadline (or none) for HTTP integration runs so a slow-but-correct response does not fail.

Terminal
schemathesis run http://localhost:8000/openapi.json \
  --hypothesis-deadline=None

Warm the service before the run

Send a warm-up request so the first generated example does not pay cold-start latency.

Terminal
curl -s http://localhost:8000/health >/dev/null
schemathesis run http://localhost:8000/openapi.json

How to prevent it

  • Set a realistic Hypothesis deadline for HTTP integration runs.
  • Warm the API before schemathesis starts generating.
  • Separate slow endpoints so one does not fail the whole suite on latency.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →