{
  "id": "python/pytest-xdist-no-worker-idle",
  "signature": "pytest.xdist.NoWorkerIdle: No idle worker available for test scheduling",
  "signature_zh": "pytest.xdist.NoWorkerIdle：没有空闲工作节点可用于测试调度",
  "regex": "pytest\\.xdist\\.NoWorkerIdle:\\ No\\ idle\\ worker\\ available\\ for\\ test\\ scheduling",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "All worker processes are busy with long-running tests, and no worker becomes free within the timeout period.",
  "root_cause_type": "generic",
  "root_cause_zh": "所有工作进程都在处理长时间运行的测试，并且在超时时间内没有工作节点空闲。",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing the number of workers to speed up tests",
      "why_fails": "If tests are long, more workers may not help if the bottleneck is I/O or CPU.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting a global timeout for all tests",
      "why_fails": "Timeout may abort tests prematurely without addressing the scheduling issue.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce the number of workers to match the number of available CPU cores.",
      "success_rate": 0.8,
      "how": "pytest -n 4 (where 4 is the number of cores)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Run long-running tests sequentially by marking them with @pytest.mark.slow and using -m 'not slow'.",
      "success_rate": 0.85,
      "how": "pytest -m 'not slow' -n auto; then run slow tests separately with -n 1",
      "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.8,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-11-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}