{
  "id": "python/pytest-timeout-failed",
  "signature": "Failed: Timeout >30.0s",
  "signature_zh": "Failed: 超时 >30.0s",
  "regex": "Failed:\\ Timeout\\ >30\\.0s",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "pytest-timeout aborts a test that exceeds its configured timeout. Often caused by a blocking network call, a deadlock on a lock, or a sleep not being mocked.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest-timeout 中止超过配置超时的测试。常见原因：阻塞的网络调用、锁死锁、或未被 mock 的 sleep。",
  "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": "Masks the real issue; the underlying hang will still occur and slow CI.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removes the safety net; a truly hung test blocks the whole run until the CI job times out.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "from unittest.mock import patch\n\n@patch('app.client.requests.get')\ndef test_fetch(mock_get):\n    mock_get.return_value.json.return_value = {'ok': True}\n    assert fetch()['ok'] is True",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "# pyproject.toml\n[tool.pytest.ini_options]\ntimeout = 30\ntimeout_method = \"thread\"\n\n# on failure a stack trace of the hung thread is printed",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-08-27",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}