{
  "id": "python/pytest-timeout-test-hangs",
  "signature": "Failed: Timeout (>30.0s) from pytest-timeout.",
  "signature_zh": "Failed: 来自 pytest-timeout 的超时（>30.0s）。",
  "regex": "Failed:\\ Timeout\\ \\(>30\\.0s\\)\\ from\\ pytest\\-timeout\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A test blocks on I/O (network, subprocess, lock) longer than the configured timeout. pytest-timeout kills the test but the underlying hang often indicates a missing mock or a deadlock.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试在 I/O（网络、子进程、锁）上阻塞时间超过配置的超时。pytest-timeout 会终止测试，但底层挂起通常表明缺少 mock 或存在死锁。",
  "versions": [
    {
      "version": "2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Slows the suite and hides the real hang; CI eventually times out at the job level.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Hung tests block CI indefinitely, requiring manual cancellation.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use the thread method to get a Python traceback at timeout:\n\npytest --timeout=30 --timeout-method=thread -s",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Mock the blocking dependency (e.g. requests.get) or use a fake server; this usually reveals the missing mock.",
      "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": "2026-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}