{
  "id": "python/pytest-timeout-test-hang",
  "signature": "TimeoutError: Test timed out after 30 seconds",
  "signature_zh": "超时错误：测试在 30 秒后超时",
  "regex": "TimeoutError:\\ Test\\ timed\\ out\\ after\\ 30\\ seconds",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A test takes longer than the specified timeout, often due to infinite loops, slow I/O, or blocking calls.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试花费的时间超过指定的超时时间，通常是由于无限循环、慢速 I/O 或阻塞调用。",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing the timeout value without investigating the cause",
      "why_fails": "The underlying issue (e.g., infinite loop) will cause the test to hang indefinitely.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing the timeout decorator to avoid failure",
      "why_fails": "The test may still hang indefinitely, blocking the test suite.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add debugging output to identify where the test hangs.",
      "success_rate": 0.85,
      "how": "Insert print statements or use logging to trace execution.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use pytest-timeout plugin to set a timeout and catch hanging tests.",
      "success_rate": 0.9,
      "how": "pytest --timeout=60 test_file.py",
      "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": "2024-09-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}