Skip to content

test(cli-fuzz): re-broaden hypothesis strategy + wire into CI - #445

Merged
fcostaoliveira merged 1 commit into
masterfrom
test/cli-fuzz-re-broaden
Jun 2, 2026
Merged

fcostaoliveira merged 1 commit into
masterfrom
test/cli-fuzz-re-broaden

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Jun 2, 2026 •

Copy link
Copy Markdown
Collaborator

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:

Also wires the fuzzer into a nightly workflow (cli-fuzz-nightly.yml) and via the run-cli-fuzz PR label so it actually runs (Review 8 flagged that it ran zero times in CI before).

Test plan

  • Nightly cron + workflow_dispatch + run-cli-fuzz label
  • FLAG_SPECS grew from 62 to 66 entries
  • Smoke run with MEMTIER_FUZZ=1 MEMTIER_FUZZ_MAX_EXAMPLES=200 passes locally
  • CI green

Refs: 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.py brings back negative ints, G:G, degenerate --data-size-list values, and flags such as --authenticate, --cluster-mode, and WAIT-family options (comments point at #428–#431/#436). FLAG_SPECS grows accordingly.

.github/workflows/cli-fuzz-nightly.yml runs tests/cli_fuzz.py on a nightly cron, manual dispatch, and PRs labeled run-cli-fuzz, with an ASAN/UBSan build against local Redis and a smaller example budget on labeled PRs.

.githooks/pre-commit finds the root Makefile from linked worktrees and sets GIT_INDEX_FILE so make format-check-staged uses the correct staged index.

Reviewed by Cursor Bugbot for commit 160eaf5. Bugbot is set up for automated code reviews on this repo. Configure here.

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-ci

jit-ci Bot commented Jun 2, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread tests/cli_fuzz.py
# 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 160eaf5. Configure here.

@fcostaoliveira
fcostaoliveira merged commit 66c8c6f into master Jun 2, 2026
90 of 91 checks passed
fcostaoliveira added a commit that referenced this pull request Jun 3, 2026
)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant