tests: add fuzz targets for trace-frame encode/decode#6
Merged
Conversation
ReadFrame / WriteFrame / ReadEvent already have Fuzz coverage in
zz_fuzz_frames_test.go. The trace-frame inner encoder/decoder
(WriteTraceFrame + ReadTracePayload) was not yet fuzzed.
zz_fuzz_trace_test.go:
- FuzzReadTracePayload: decoder fuzz; 5 seeds including the
one-byte-under-minimum guard case
- FuzzWriteThenReadTrace: round-trip property — encode arbitrary
(innerType, sentAt, payload) and assert the
three fields survive ReadFrame +
ReadTracePayload
30s local runs: both PASS, ~3M execs each, zero panics, zero hangs,
zero crash-corpus entries written. Existing FuzzDataExchangeReadFrame /
RoundTrip / FileFrame and FuzzEventStream* targets also re-run clean
(2.7M / 3.0M / 250k / 2.4M / 3.3M execs respectively).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReadFrame/WriteFrame/ReadEvent/WriteEventare already fuzzed inzz_fuzz_frames_test.go. The trace-frame inner encoder/decoder (WriteTraceFrame+ReadTracePayload) was not.zz_fuzz_trace_test.go:FuzzReadTracePayload— direct decoder fuzz with 5 seeds, including the one-byte-under-minimum guard case.FuzzWriteThenReadTrace— round-trip property: encode arbitrary (innerType,sentAt,payload), thenReadFrame+ReadTracePayload, assert the three fields survive.Local fuzz run (30s per target)
Zero panics, zero crash-corpus entries. (One transient "context deadline exceeded" on
FuzzDataExchangeFileFrameduring back-to-back runs — did not reproduce on rerun, no testdata artefact written, attributed to CPU contention from running five fuzz targets sequentially. Not a real find.)Test plan
go test -race -count=1 -timeout 60s ./...— green (seed corpus runs as ordinary unit test)go test -run='^$' -fuzz=FuzzReadTracePayload -fuzztime=30s .— PASSgo test -run='^$' -fuzz=FuzzWriteThenReadTrace -fuzztime=30s .— PASSgit statusclean (notestdata/fuzz/artefacts)