Repository navigation
fix(go): keep fuzz failing-input and re-run lines in test output - #4438
Open
Ashutosh-Panda2004 wants to merge 1 commit into
Open
Ashutosh-Panda2004 wants to merge 1 commit into
Ashutosh-Panda2004 wants to merge 1 commit into
Conversation
When a fuzz target fails, go test -json reports where the failing
input was saved and how to re-run it:
Failing input written to testdata/fuzz/FuzzRev/f7d774048ada30d0
To re-run:
go test -run=FuzzRev/f7d774048ada30d0
select_go_test_failure_lines kept neither: both lines match no
location or failure-keyword pattern, and a blank separator line after
the assertion resets the follow-up context before they arrive. The
filtered output showed only the assertion, sending the user to the
tee log for the two lines they actually need.
Treat the corpus-path line and the "To re-run:" header as failure
lines, and keep the line after "To re-run:" as context, the same way
the line after a file location is kept.
📊 Automated PR Analysis
SummaryFixes the Go test output filter so that when a fuzz target fails, the 'Failing input written to...' line and the 'To re-run:' header plus its command line are preserved instead of being stripped. Adds a regression test covering the real JSON stream shape produced by a Go fuzz crash. Review Checklist
Linked issues: #4434 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Ashutosh-Panda2004
force-pushed
the
fix/go-fuzz-failure-lines
branch
from
October 12, 2026 18:07
eb51bc1 to
482e028
Compare
2 of 3 tasks
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.
When a fuzz target fails,
rtk go testshowed only the assertion line. The two lines that make the failure reproducible — where the failing input was saved and the re-run command — were filtered out: they match neither the location nor the failure-keyword patterns inselect_go_test_failure_lines, and the blank line after the assertion resets the follow-up context before they arrive.The filter now treats the corpus-path line and the
To re-run:header as failure lines, and keeps the command line that follows the header, the same way the line after a file location is already kept. A regression test covers the stream shape a fuzz crash produces.Local verification:
cargo fmt --all -- --checkandcargo clippy --all-targetsare clean, andcargo test --allpasses (3853 unit tests, including the new one). One integration test,unwritable_hooks_dir_never_breaks_the_hookin tests/copilot_selfheal_test.rs, fails in my sandbox — it fails identically on unmodified develop, because tests run as root there and the chmod-based unwritable directory stays writable. I also reproduced the issue end to end with Go 1.26.6 before and after: the filtered output now shows the assertion, the corpus path and the re-run command.Closes #4434