feat: wider fuzz tests, stronger options. #9

Merged
mvhutz merged 5 commits from fix/infinite-put-glitch into main 2026-03-25 01:26:57 +00:00
2 changed files with 12 additions and 6 deletions
Showing only changes of commit b499fa9c05 - Show all commits

View File

@@ -45,15 +45,23 @@ func FuzzInsertLookup(f *testing.F) {
return return
} }
if scenario.seedA == scenario.seedB {
return
}
seedA, seedB := scenario.seedA, scenario.seedB seedA, seedB := scenario.seedA, scenario.seedB
growthFactor := max(2, int(scenario.growthFactor)) growthFactor := max(2, int(scenario.growthFactor))
capacity := int(scenario.capacity) capacity := int(scenario.capacity)
minimumLoad := math.Abs(math.Mod(scenario.load, 1.0)) minimumLoad := math.Abs(math.Mod(scenario.load, 1.0))
// If they are the same number, the hashes will clash, always causing an
// error.
if seedA == seedB {
t.Skip()
}
// If the load is too high, the hashs will not be able to allocate
// properly.
if minimumLoad > 0.20 {
t.Skip()
}
fmt.Fprintf(os.Stderr, "seedA=%d seedB=%d capacity=%d growthFactor=%d minimumLoad=%f\n", fmt.Fprintf(os.Stderr, "seedA=%d seedB=%d capacity=%d growthFactor=%d minimumLoad=%f\n",
seedA, seedB, capacity, growthFactor, minimumLoad) seedA, seedB, capacity, growthFactor, minimumLoad)

View File

@@ -1,2 +0,0 @@
go test fuzz v1
[]byte("1000010X17000A11\xf5XA000\xe00001aA120000000000000111220000122910000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")