{
  "id": "python/pytest-benchmark-flaky-threshold",
  "signature": "pytest_benchmark.fixture.BenchmarkFixture: Benchmark 'test_sort' failed: 5.21ms > 5.00ms (threshold)",
  "signature_zh": "pytest_benchmark.fixture.BenchmarkFixture: 基准 'test_sort' 失败: 5.21ms > 5.00ms（阈值）",
  "regex": "pytest_benchmark\\.fixture\\.BenchmarkFixture:\\ Benchmark\\ 'test_sort'\\ failed:\\ 5\\.21ms\\ >\\ 5\\.00ms\\ \\(threshold\\)",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "pytest-benchmark's --benchmark-max-time or comparison threshold is too tight for noisy CI hardware; a few microseconds of variance trips the gate.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest-benchmark 的 --benchmark-max-time 或比较阈值对嘈杂的 CI 硬件过紧；几微秒的波动就会触发失败。",
  "versions": [
    {
      "version": "4.0.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Disables the benchmark entirely; performance regressions no longer surface.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Test ordering isn't the cause; hardware variance and CPU steal still produce flaky results.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "pytest --benchmark-only \\\n  --benchmark-compare=baseline \\\n  --benchmark-compare-fail=median:15%",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.87,
      "how": "pytest --benchmark-only --benchmark-disable-gc \\\n  --benchmark-save=ci-$CI_RUN_ID\n# Compare offline; only fail on >25% median regression",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2025-10-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}