Add a fuzz test for arbitrary string partitioning - #4608
Draft
jgao54 wants to merge 9 commits into
Draft
Conversation
if fetchNextRealKey does not find a valid key; try fetchPrevRealKey before deeming the partition as unsplittable. This is useful for narrow ranges
…e sensitive data, make test verify contiguous chain
ilidemi
approved these changes
Jul 23, 2026
| protos.MySqlFlavor_MYSQL_MYSQL, protos.MySqlReplicationMechanism_MYSQL_GTID) | ||
| conn, err := NewMySqlConnector(ctx, config) | ||
| if err != nil { | ||
| f.Skipf("mysql integration environment not available: %v", err) |
Contributor
There was a problem hiding this comment.
Fuzz tests are excluded from test runs by default, and if there's ever a fuzz job, we'd want it to not skip silently, so I think it's ok to require no error
|
|
||
| var charsets []string | ||
| for cs := range collationsByCharset { | ||
| if _, ok := fuzzCharsetEncodings[cs]; ok { |
Contributor
There was a problem hiding this comment.
Do we expect CI mysql to routinely have charsets outside of the list? Failing on !ok could be a smoke probe if something gets added in a new version
| raw = append(raw, byte(rng.UintN(256))) | ||
| } | ||
| } | ||
| f.Add(raw, uint8(idx), uint8(idx)) |
Contributor
There was a problem hiding this comment.
nit: can add all combos of charset x collation, to not rely on the fuzzer for this
| // exactly once by the partitions. Test requires PeerDB catalog and MySQL to be | ||
| // running. Example: | ||
| // | ||
| // go test ./connectors/mysql/ -run '^$' -fuzz '^FuzzMySQLStringPartitionCoverage$' -fuzztime 1h |
Contributor
There was a problem hiding this comment.
Suggested change
| // go test ./connectors/mysql/ -run '^$' -fuzz '^FuzzMySQLStringPartitionCoverage$' -fuzztime 1h | |
| // go test ./connectors/mysql/ -run '^$' -fuzz '^FuzzMySQLStringPartitionCoverage$' -fuzztime 1h -parallel=2 |
as 14 cores contend the mysql side
also for 1 min test I needed -fuzzminimizetime=1x (or at least 1s) to get a decent throughput but not sure what's optimal for 1h
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.
No description provided.