{
  "id": "java/mockito-verify-timeout-interrupted",
  "signature": "java.lang.InterruptedException: sleep interrupted",
  "signature_zh": "中断异常：睡眠被中断",
  "regex": "java\\.lang\\.InterruptedException:\\ sleep\\ interrupted",
  "domain": "java",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "verify with timeout uses a background thread that gets interrupted, often due to test timeout or thread issues.",
  "root_cause_type": "generic",
  "root_cause_zh": "带有超时的 verify 使用后台线程，该线程被中断，通常由于测试超时或线程问题。",
  "versions": [
    {
      "version": "8+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Removing timeout from verify",
      "why_fails": "May cause test to hang indefinitely.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Catching InterruptedException and ignoring",
      "why_fails": "Hides real threading issues; test may pass incorrectly.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase test timeout to accommodate verify timeout",
      "success_rate": 0.85,
      "how": "@Timeout(10)\n@Test\nvoid asyncTest() {\n    verify(mock, timeout(5000)).method();\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use awaitility library for async tests",
      "success_rate": 0.9,
      "how": "await().atMost(5, SECONDS).untilAsserted(() -> {\n    verify(mock).method();\n});",
      "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.81,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}