{"record":{"id":"b57f3c5418136534","repo":"tursodatabase/turso","slug":"runs-must-be-positive","errorCode":null,"errorMessage":"runs must be positive","messagePattern":"runs must be positive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"perf/fts/src/main.rs","lineNumber":52,"sourceCode":"    )]\n    targets: Vec<Target>,\n    #[arg(long, default_value_t = 1)]\n    connections: usize,\n    #[arg(\n        long,\n        value_enum,\n        value_delimiter = ',',\n        default_value = \"rare,common,and,or,phrase,ranked\"\n    )]\n    cases: Vec<QueryCase>,\n    #[cfg(all(feature = \"flamegraph\", any(target_os = \"linux\", target_os = \"macos\")))]\n    #[arg(long)]\n    flamegraph: Option<std::path::PathBuf>,\n}\n\nfn main() -> Result<()> {\n    let args = Args::parse();\n    ensure!(args.runs > 0, \"runs must be positive\");\n    ensure!(args.connections > 0, \"connections must be positive\");\n    eprintln!(\"bundled SQLite version: {}\", rusqlite::version());\n    let runtime = match args.benchmark {\n        Benchmark::Search => tokio::runtime::Builder::new_current_thread()\n            .enable_all()\n            .build()?,\n        Benchmark::Throughput => tokio::runtime::Builder::new_multi_thread()\n            .worker_threads(args.connections)\n            .max_blocking_threads(args.connections)\n            .enable_all()\n            .build()?,\n    };\n    runtime.block_on(run(args))\n}\n\nasync fn run(mut args: Args) -> Result<()> {\n    let (query_limit, min_seconds) = match args.benchmark {\n        Benchmark::Search => {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/tursodatabase/turso/blob/8d4a589f8d13ac184700d2a8f724f27e1995be3b/perf/fts/src/main.rs#L34-L70","documentation":"The FTS benchmark CLI validates its arguments after parsing and rejects a non-positive `--runs` value. Running zero or negative repetitions is meaningless for benchmark aggregation, so main exits immediately with this message.","triggerScenarios":"Invoking the perf/fts binary with `--runs 0` or a negative value on the command line.","commonSituations":"Scripting the benchmark with a computed run count that resolved to 0, or copying a CLI example and leaving a placeholder value.","solutions":["Re-run with `--runs` set to a positive integer (e.g. `--runs 10`).","Fix the script/variable producing the run count so it is >= 1.","Add a clap value_parser range constraint so the error surfaces at parse time."],"exampleFix":"// before\nperf-fts --runs 0\n// after\nperf-fts --runs 10","handlingStrategy":"validation","validationCode":"if runs <= 0 { eprintln!(\"--runs must be a positive integer\"); std::process::exit(2); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate benchmark parameters in scripts before invoking the binary","Use clap value_parser!(u32..) or a range parser","Default runs to a sensible positive value in wrappers"],"tags":["cli","validation","benchmark"],"backgroundTag":"invalid-cli-argument","analyzedSha":"8d4a589f8d13ac184700d2a8f724f27e1995be3b","analyzedAt":"2026-09-20T13:18:14.658Z","contentChangedAt":"2026-09-20T13:18:14.658Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}