{
  "id": "python/pytest-timeout-exceeded-hanging-test",
  "signature": "Failed: Timeout (>60.0s) from pytest-timeout.",
  "signature_zh": "Failed: 来自 pytest-timeout 的超时 (>60.0s)。",
  "regex": "Failed:\\ Timeout\\ \\(>60\\.0s\\)\\ from\\ pytest\\-timeout\\.",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A test or fixture blocked longer than the configured timeout — often due to a network call without timeout, an unclosed DB connection, or a deadlock in a threaded fixture.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试或 fixture 阻塞时间超过配置的超时——常见原因是无超时的网络调用、未关闭的数据库连接，或线程 fixture 中的死锁。",
  "versions": [
    {
      "version": "2.2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Masks the hang; CI still stalls and the underlying deadlock remains, eventually failing at a higher timeout.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Thread method can't interrupt blocking C calls (e.g., socket recv); the test still hangs and gets killed at signal level.",
      "fail_rate": 0.55,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "import httpx\nr = httpx.get(url, timeout=5.0)\n\n# or requests\nrequests.get(url, timeout=(3.05, 5))",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "# pytest.ini\n[pytest]\ntimeout = 30\ntimeout_method = signal\n\n# per test\n@pytest.mark.timeout(10)\ndef test_fast(): ...",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-30",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}