{
  "id": "python/pytest-timeout-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 blocks longer than the configured timeout, often due to a network call, deadlock, or an unclosed resource waiting on input.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试阻塞超过配置的超时时间，通常由网络调用、死锁或未关闭的资源等待输入引起。",
  "versions": [
    {
      "version": "7.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides the underlying hang; CI duration balloons and the real bug (deadlock, missing mock) persists.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Test suite hangs indefinitely in CI, blocking the whole pipeline until the job-level timeout.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Loses coverage and leaves the bug in production code undetected.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "from unittest import mock\n\ndef test_fetch(monkeypatch):\n    monkeypatch.setattr('myapp.client.requests.get', lambda *a, **k: FakeResp())\n    assert myapp.client.fetch()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "# pytest.ini\n[pytest]\ntimeout = 60\ntimeout_method = signal\n# on failure, pytest prints the stack where the test hung",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}