{
  "slug": "k6-once-runs-the-configured-scenario-once-04c5aa3dee49",
  "title": "k6 --once runs the configured scenario once",
  "tools": [
    "k6"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-21T15:17:03.000Z",
  "announced_at": "2026-09-21T15:17:03.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When debugging a script with at most one configured scenario, run `k6 run --once script.js` to execute its function once with one VU and one iteration while preserving scenario settings, including browser settings.",
    "examples": [
      "k6 run --once <script.js>"
    ],
    "gotchas": [
      "Version: v2.3.0",
      "--once (required): Runs one iteration with one VU. For one configured scenario, uses `shared-iterations` and preserves its function and settings; executor timing defaults are applied.",
      "<script.js> (required): Path to the script to run.",
      "Supports scripts with at most one scenario."
    ]
  },
  "why_it_matters": "When debugging a script with one configured scenario, run its function once while retaining its browser configuration.",
  "before": "Shortcuts such as `--vus 1 --iterations 1` replaced the script’s scenarios with a default scenario, potentially discarding the selected function and browser options.",
  "sources": [
    "https://github.com/grafana/k6/releases/tag/v2.3.0",
    "https://grafana.com/docs/k6/v2.3.x/using-k6/k6-options/reference/"
  ],
  "rank": 0.98032,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2a-20261017",
    "verdict_id": "wave2a-20261017:wave2a-20261017-65a244af489b5976-1:gate",
    "evidence_hash": "dba6ea361338a6ce929886692010d6448197e9e669546fe9ff9e6f7cea7e9e36"
  },
  "review": {
    "draft_hash": "fff0657bb9cbbb41b5a39da8f0e26f1607ee1a9bfbacafe44ee1aafc9ec4fd30",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2a-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.75 (>= 0.6 needed)."
  }
}
