{
  "id": "python/pytest-hypothesis-deadline-exceeded",
  "signature": "hypothesis.errors.DeadlineExceeded: Test took 412.34ms, which exceeds the deadline of 200.00ms",
  "signature_zh": "hypothesis.errors.DeadlineExceeded: 测试耗时 412.34ms，超过 200.00ms 的截止时间",
  "regex": "hypothesis\\.errors\\.DeadlineExceeded:\\ Test\\ took\\ 412\\.34ms,\\ which\\ exceeds\\ the\\ deadline\\ of\\ 200\\.00ms",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Hypothesis enforces a per-example deadline; slow test bodies, cold caches, or CI noise cause intermittent DeadlineExceeded failures.",
  "root_cause_type": "generic",
  "root_cause_zh": "Hypothesis 对每个示例强制执行截止时间；慢速测试体、冷缓存或 CI 噪声会导致间歇性的 DeadlineExceeded 失败。",
  "versions": [
    {
      "version": "6.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides real performance regressions and makes flakiness reappear as timeouts elsewhere.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Warms caches but doesn't stop Hypothesis from measuring the slow example; may still exceed deadline.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Loses the value of property-based testing and may still hit the deadline on the first example.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "from hypothesis import given, settings, strategies as st\n\n@settings(deadline=1000)  # ms\n@given(st.integers())\ndef test_parse(n):\n    assert parse(n) == n",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "# Use hypothesis' --hypothesis-show-statistics and cProfile\npytest --hypothesis-show-statistics tests/test_x.py\n# optimize hot paths in the code under test",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-08-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}