{
  "id": "ros2/colcon-test-return-code-2",
  "signature": "colcon test: Return code 2. Some tests failed. See output for details.",
  "signature_zh": "colcon测试：返回码2。部分测试失败。详情见输出。",
  "regex": "Return code 2\\. Some tests failed",
  "domain": "ros2",
  "category": "test_error",
  "subcategory": null,
  "root_cause": "One or more test cases in the ROS2 package returned non-zero exit status, often due to assertion failures, missing dependencies, or runtime exceptions during test execution.",
  "root_cause_type": "generic",
  "root_cause_zh": "ROS2包中的一个或多个测试用例返回非零退出状态，通常由断言失败、缺少依赖或测试执行期间的运行时异常导致。",
  "versions": [
    {
      "version": "Humble",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Iron",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Jazzy",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Rolling",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Re-running colcon test without cleaning build artifacts",
      "why_fails": "Stale test binaries or cached results may mask underlying failures; a clean rebuild is needed.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disabling all tests with --packages-select and --mixin skip-tests",
      "why_fails": "This bypasses the problem without fixing it, leaving broken tests for later.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrading colcon-core to latest version",
      "why_fails": "The error is test-logic related, not a colcon tool bug.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run colcon test with --event-handlers console_direct+ to see detailed test output and identify failing tests.",
      "success_rate": 0.9,
      "how": "Run colcon test with --event-handlers console_direct+ to see detailed test output and identify failing tests.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check test log files in 'log/test_*' directory for specific failure messages.",
      "success_rate": 0.85,
      "how": "Check test log files in 'log/test_*' directory for specific failure messages.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Update test dependencies in package.xml and run 'rosdep install -i --from-paths src' to ensure all test packages are installed.",
      "success_rate": 0.75,
      "how": "Update test dependencies in package.xml and run 'rosdep install -i --from-paths src' to ensure all test packages are installed.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Run colcon test with --event-handlers console_direct+ to see detailed test output and identify failing tests.",
    "Check test log files in 'log/test_*' directory for specific failure messages.",
    "Update test dependencies in package.xml and run 'rosdep install -i --from-paths src' to ensure all test packages are installed."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.ros.org/en/rolling/Tutorials/Intermediate/Testing/Testing.html",
  "official_doc_section": null,
  "error_code": "2",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-06-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}