Skip to content

test: fuzz targets for query binder, error writer, roster enum parse#192

Merged
SyniRon merged 1 commit into
developfrom
test/fuzz-targets
Jun 8, 2026
Merged

test: fuzz targets for query binder, error writer, roster enum parse#192
SyniRon merged 1 commit into
developfrom
test/fuzz-targets

Conversation

@SyniRon

@SyniRon SyniRon commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

What

Coverage-guided Go fuzz targets for the three panic-prone pure-function seams PRD #112 flags as the lenient request surface:

  • FuzzQueryBinder (rest) — no accessor panics on any url.Values; first-failure-wins is monotone (a later successful read never clears an earlier 400, the invariant that makes the "bind everything, check Err() once" handler protocol safe).
  • FuzzWriteError (rest) — arbitrary user-derived message bytes (control chars, invalid UTF-8) always yield valid gRPC-status contract JSON: code echoed, details: [], code→HTTP-status mapping intact, Content-Type: application/json.
  • FuzzParseRosterType (types) — never panics on the base-0 name-or-number enum forms (hex/octal/binary/underscore/overflow/negative/empty); any clean parse round-trips through its enum name.

Why

These exercise the binding/error seams at millions of cases/sec in-process — coverage the golden corpus (recorded inputs) and Schemathesis (network edge) can't reach. They surfaced during a live smoke of the new stack; the network side came back clean, and these lock the unit seams down permanently.

Cost

Standard testing.F targets: a normal go test ./... runs only their seed corpora as fast deterministic unit tests — no fuzzing cost in CI unless -fuzz is invoked explicitly. CI can optionally add a bounded -fuzztime pass.

Verification

~870k execs across the three during the smoke, zero crashes, zero invariant violations. Seed corpora green on a clean develop base.

This was generated by AI

Coverage-guided fuzzing of the three panic-prone pure-function seams the
PRD flags as the lenient surface:

- FuzzQueryBinder: no accessor panics; first-failure-wins is monotone
  (a later successful read never clears an earlier 400).
- FuzzWriteError: arbitrary user-derived message bytes (control chars,
  invalid UTF-8) always yield valid gRPC-status contract JSON with the
  code echoed, details=[], and the code->status mapping intact.
- FuzzParseRosterType: never panics; any clean parse round-trips through
  its enum name.

Real test assets — independent of the smoke wiring, land separately.
~870k execs across the three, zero crashes.

This was generated by AI
@SyniRon SyniRon merged commit 4c78d6a into develop Jun 8, 2026
3 checks passed
@SyniRon SyniRon deleted the test/fuzz-targets branch June 8, 2026 03:09
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