fix: make fuzz run without fuzzy harness errors#678
Open
anyasabo wants to merge 1 commit into
Open
Conversation
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
471717c to
cada209
Compare
Author
|
@tgross done, sorry for the time. took another pass and lgtm too and removed llm authorship |
Member
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.
Hi friends long time no see. I was trying to run
make fuzzlocally and it panicked relatively quickly which was surprising. I then saw it wasn't because it found a bug bug, just a bug in the harness :/ The fix did not seem that complicated though. I wonder if we should run these regularly (or least annually?) or remove themclanker generated pr desc below
Summary
This PR fixes fuzzy-harness failures that could make
make fuzzfail for harness reasons unrelated to Raft correctness.Specifically, it:
Future.Error()when no leader exists, instead of panickingProblem
make fuzzwas not reliably usable as a correctness signal because the harness had two gaps:Missing pre-vote decode path in
fuzzy/transport.goRequestVote,AppendEntries, etc., but did not decodeRequestPreVoteRequestinsidesendRPC.#530, commit181475c), while the fuzzy transport code path predates that work. TheRequestPreVotemethod was added, but the decode switch was not updated for the new request type.unexpected request type: *raft.RequestPreVoteRequestRPC does not have a headerNil dereference during leadership transfer in
fuzzy/cluster.gocluster.leadershipTransfer()assumed a leader existed and dereferencedldr.raft.Impact of the bug
The impact is on test reliability and signal quality:
make fuzzcould fail due to harness defects, not Raft logic.Why this fix is necessary
Fuzzing is only useful when the harness both:
Without this fix, pre-vote election traffic is mis-modeled and no-leader transfer scenarios crash instead of returning explicit errors.
Why this is more correct
This change aligns the harness with Raft expectations and Go API contracts:
In short, failures become deterministic and diagnosable test failures rather than runtime panics.
Scope / Risk
Scope is intentionally narrow:
fuzzy/cluster.gofuzzy/leadershiptransfer_test.gofuzzy/transport.goNo Raft core algorithm changes, no CI workflow changes.
Test Plan
go test -count=1 -run 'TestRaft_FuzzyLeadershipTransfer|TestRaft_FuzzyLeadershipTransferWithoutLeader' ./fuzzymake fuzz