Skip to content

fix(go): keep the fuzz corpus path and re-run command - #4437

Closed
ump45nose wants to merge 1 commit into
rtk-ai:developfrom
ump45nose:fix/go-test-fuzz-failing-input
Closed

ump45nose wants to merge 1 commit into
rtk-ai:developfrom
ump45nose:fix/go-test-fuzz-failing-input

Conversation

@ump45nose

Copy link
Copy Markdown

Summary

  • Keep the Failing input written to testdata/fuzz/... line and the To re-run: / go test -run=... pair in rtk go test output when a fuzz target fails. Fixes rtk go test: a failing fuzz run drops the failing-input path and the re-run command #4434.
  • select_go_test_failure_lines dropped them because they match neither is_go_test_location_line nor is_go_test_failure_line; To re-run: is only a label for the command on the next line, so the two are treated as a unit now.
  • Add a test on the go test -json event stream of a failing fuzz run.

Before:

foo (0 passed, 1 failed)
  [FAIL] FuzzRev
     rev_test.go:18: not involutive
     Failing input written to testdata/fuzz/FuzzRev/f7d774048ada30d0

After:

foo (0 passed, 1 failed)
  [FAIL] FuzzRev
     rev_test.go:18: not involutive
     Failing input written to testdata/fuzz/FuzzRev/f7d774048ada30d0
     To re-run:
     go test -run=FuzzRev/f7d774048ada30d0

(Context left in the tee log so the agent can still reach the rest.)

Test plan

  • cargo fmt --all --check, cargo clippy --all-targets, and cargo test — fmt and clippy clean, cargo test 4113 passed / 0 failed.
  • The new test fails on develop with exactly the reported symptom (the corpus path survived as context but To re-run: and the go test -run=... line were gone) and passes with the change.
  • Not manually run against a real -fuzz run: I have no machine with Go installed here, so the re-run is pinned to the event stream transcribed in the issue rather than a live go test -fuzz invocation.

AI disclosure

This change was written with the assistance of an AI agent. The root-cause analysis, the exact output shape, and the reproduction transcription in issue #4434 came from the human reporter, and I verified the before/after behaviour against the repo's own test fixtures rather than asserting it.

`rtk go test` reported the failing assertion of a fuzz target but dropped
the two lines Go adds after it: the path the failing input was written to
and the `go test -run=...` command that reproduces it. Both are outside
`select_go_test_failure_lines`, so the agent had to open the tee log to
reproduce the failure or hand the corpus file over.

Mark both lines as fuzz re-run markers so the pair survives, and pin it
with a test on the event stream of a failing fuzz run.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added bug Something isn't working go output labels Oct 3, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes a Go test output filter that stripped the 'To re-run:' line and its associated 'go test -run=...' command when a fuzz test fails, while keeping the 'Failing input written to' corpus path. The fix treats the rerun marker and its following command line as a unit so both survive the filter, and adds a test covering the go test -json event stream for a failing fuzz run.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #4434


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@KuSh

KuSh commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Closing this in favour of #4438, which fixes the same #4434 fuzz-failure filtering in go_cmd.rs with the same approach. It was kept because its CLA is signed and its test reproduces a real Go 1.26 fuzz crash stream, including the blank separator line. Review or comments are welcome on #4438, or reply here if your change covers something it does not.

@KuSh KuSh closed this Oct 18, 2026
@KuSh KuSh added the duplicate This issue or pull request already exists label Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists go output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rtk go test: a failing fuzz run drops the failing-input path and the re-run command

3 participants