Repository navigation
test(cli-fuzz): re-broaden hypothesis strategy + wire into CI - #445
Conversation
The fuzzer excluded flags/inputs (--cluster-mode against standalone, --authenticate empty, --wait-ratio, G:G degenerate, --data-size-list zero-weight/zero-size, negative count flags) because they used to crash or hang. The phase-1-3 parser fixes (#427/#428/#429/#430) plus the connection-stage-timeout supervisor (#431) now bound all of those. Removed the exclusions and wired the fuzzer into CI so it runs nightly. Also fix .githooks/pre-commit to work from linked worktrees: locate the Makefile via git-common-dir and export GIT_INDEX_FILE so that `git diff --cached` inside the Makefile rule sees the worktree-local index rather than the main worktree's index. Refs: 2.4 review #20 (Review 8 + Review 17). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 160eaf5. Configure here.
| # excluded: they require a replication topology and against a standalone | ||
| # Redis they block on WAIT(n,t) for the full timeout, blowing the | ||
| # 10s subprocess deadline. Like --cluster-mode and --tls*, fuzzing them | ||
| # properly needs a dedicated harness; see #410 follow-ups. |
There was a problem hiding this comment.
Harness missing connection-stage-timeout below subprocess deadline
High Severity
The PR removes exclusions for --authenticate, --cluster-mode, and the wait-family flags, claiming the --connection-stage-timeout supervisor (#431) will terminate hangs before the 10-second subprocess deadline. However, _run_memtier never passes --connection-stage-timeout, and its default is 30 seconds (memtier_benchmark.cpp:825). Since 30s > 10s, the supervisor can never fire before the subprocess times out — the exact hang behavior the old exclusion comments described will still cause TimeoutExpired test failures.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 160eaf5. Configure here.
) The CLI fuzz nightly (#445) re-broadened FLAG_SPECS to include --authenticate and similar flags whose runaway behavior the connection-stage supervisor (#431) is supposed to bound. But the harness left --connection-stage-timeout at its 30 s default while the fuzz subprocess timeout is 10 s, so cases like `--authenticate ''` against a no-auth server hit the harness timeout before the supervisor could fire -- producing spurious 'hung (>10s)' failures. Pass --connection-stage-timeout=3 in the canonical args so the supervisor reliably terminates within the 10 s harness window. extra_args is appended after, so any fuzzed value of the same flag still wins (last-flag-wins). Refs: master nightly cli-fuzz failure on 03ef76e.


Summary
The Hypothesis-based CLI fuzzer (tests/cli_fuzz.py) had several deliberately excluded flags/inputs that previously caused crashes or infinite hangs. Those exclusions are now dead weight: the parser-level validators (#427/#428/#429/#430) reject the bad inputs at parse time, and the connection-stage-timeout supervisor (#431) bounds the runtime cases.
Removed exclusions:
-1,-100) — fix(opts): reject negative -c/-t/-n/--test-time; guard Hits/sec from /0 #436 parser rejectsG:Gkey pattern degenerate range — fix(opts): validate sampler configs (--data-size-list, --key-stddev, --key-pattern=G:G) (Refs #426 phase 3) #430 parser rejects--data-size-list 8:0/0:50— fix(opts): validate --pipeline / --data-size / --data-size-list size (Refs #426 phase 2b) #428/fix(opts): validate sampler configs (--data-size-list, --key-stddev, --key-pattern=G:G) (Refs #426 phase 3) #430 parser rejects--cluster-mode,--authenticate,--wait-ratio,--num-slaves,--wait-timeout— fix(connection-stage): bound retry loop with --connection-stage-timeout (Refs #426 phase 1) #431 supervisor terminatesAlso wires the fuzzer into a nightly workflow (
cli-fuzz-nightly.yml) and via therun-cli-fuzzPR label so it actually runs (Review 8 flagged that it ran zero times in CI before).Test plan
workflow_dispatch+run-cli-fuzzlabelMEMTIER_FUZZ=1 MEMTIER_FUZZ_MAX_EXAMPLES=200passes locallyRefs: 2.4 review #20 (Review 8 + Review 17).
Note
Low Risk
Changes are fuzz coverage, CI automation, and pre-commit worktree behavior; no production runtime paths in the diff.
Overview
Re-expands the Hypothesis CLI fuzz corpus now that parser guards and the connection-stage-timeout supervisor are expected to bound former crash/hang cases, and adds CI so the fuzzer actually runs.
tests/cli_fuzz.pybrings back negative ints,G:G, degenerate--data-size-listvalues, and flags such as--authenticate,--cluster-mode, and WAIT-family options (comments point at #428–#431/#436).FLAG_SPECSgrows accordingly..github/workflows/cli-fuzz-nightly.ymlrunstests/cli_fuzz.pyon a nightly cron, manual dispatch, and PRs labeledrun-cli-fuzz, with an ASAN/UBSan build against local Redis and a smaller example budget on labeled PRs..githooks/pre-commitfinds the rootMakefilefrom linked worktrees and setsGIT_INDEX_FILEsomake format-check-stageduses the correct staged index.Reviewed by Cursor Bugbot for commit 160eaf5. Bugbot is set up for automated code reviews on this repo. Configure here.