tursodatabase/turso · error
--seconds requires --benchmark throughput
Error message
--seconds requires --benchmark throughput
What it means
The FTS benchmark runner only accepts --seconds (benchmark duration) when running the throughput benchmark. In the Search benchmark branch of run(), ensure! rejects any invocation where --seconds was supplied, because search benchmarks are query-count driven, not time driven. This is CLI argument validation to prevent ambiguous benchmark configurations.
Solutions
- Remove --seconds from the command line when using the search benchmark
- Switch to --benchmark throughput if a time-limited run is actually desired
- If a wrapper script always passes --seconds, make it conditional on the benchmark mode
Example fix
// before fts-bench --benchmark search --seconds 10 --queries 1000 // after fts-bench --benchmark search --queries 1000
Defensive patterns
Strategy: validation
Validate before calling
if benchmark == Search && seconds.is_some() { panic!("--seconds only applies to --benchmark throughput"); } Prevention
- Keep one script per benchmark mode with only that mode's flags
- Read --help output before composing flags
- Validate CLI flags in wrapper scripts before invoking the binary
When it happens
Trigger: Running the perf/fts binary with both --benchmark search (or default search) and a --seconds value, e.g. `fts-bench --benchmark search --seconds 10`. The ensure! at perf/fts/src/main.rs:71 fires inside run() whenever args.benchmark is Benchmark::Search and args.seconds.is_some().
Common situations: Developers copying a throughput-benchmark command line and switching only the benchmark name; scripting harnesses that always pass --seconds regardless of benchmark mode; misunderstanding that search mode measures fixed query counts rather than a time window.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- first-query latency requires one query per connection
- need at least one query per connection
- --queries requires --benchmark search
- seconds must be finite and positive
- throughput requires --state warm
AI-assisted analysis of tursodatabase/turso@8d4a589f8d (2026-09-20).
Data as JSON: /api/errors/8111f0cbcb287b2d.
Report an issue: GitHub.
Appendix: source
Thrown at perf/fts/src/main.rs:71
ensure!(args.connections > 0, "connections must be positive");
eprintln!("bundled SQLite version: {}", rusqlite::version());
let runtime = match args.benchmark {
Benchmark::Search => tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()?,
Benchmark::Throughput => tokio::runtime::Builder::new_multi_thread()
.worker_threads(args.connections)
.max_blocking_threads(args.connections)
.enable_all()
.build()?,
};
runtime.block_on(run(args))
}
async fn run(mut args: Args) -> Result<()> {
let (query_limit, min_seconds) = match args.benchmark {
Benchmark::Search => {
ensure!(
args.seconds.is_none(),
"--seconds requires --benchmark throughput"
);
let queries = args
.queries
.unwrap_or(if matches!(args.state, QueryState::First) {
args.connections
} else {
10_000
});
ensure!(
queries >= args.connections,
"need at least one query per connection"
);
ensure!(
!matches!(args.state, QueryState::First) || queries == args.connections,
"first-query latency requires one query per connection"
);View on GitHub (pinned to 8d4a589f8d)