Skip to content

Commit

Permalink
Fuzz honest multi-instance with incremental network sizes
Browse files Browse the repository at this point in the history
`FuzzHonestMultiInstance_AsyncAgreement` intermittently fails on CI,
most likely due to taking too long to complete a test.

To avoid intermittent failures:
* Decrease the instance count to 3K
* change the honest multi instance tests to cover incremental network
  sizes, up to 5 for sync and up to 4 for async
* add additional static corpus to the async test for better coverage.

Fixes #251
  • Loading branch information
masih committed May 24, 2024
1 parent add8260 commit 9b03360
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions test/multi_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,37 @@ func FuzzHonestMultiInstance_AsyncDisagreement(f *testing.F) {

func FuzzHonestMultiInstance_SyncAgreement(f *testing.F) {
const (
instanceCount = 4000
honestCount = 5
instanceCount = 4000
maxHonestCount = 5
)
f.Add(-47)
f.Fuzz(func(t *testing.T, seed int) {
multiAgreementTest(t, seed, honestCount, instanceCount, maxRounds, syncOptions()...)
t.Parallel()
for hc := 2; hc <= maxHonestCount; hc++ {
hc := hc
t.Run(fmt.Sprintf("%d", hc), func(t *testing.T) {
multiAgreementTest(t, seed, hc, instanceCount, maxRounds, syncOptions()...)
})
}
})
}

func FuzzHonestMultiInstance_AsyncAgreement(f *testing.F) {
const (
instanceCount = 4000
honestCount = 5
instanceCount = 3000
maxHonestCount = 4
)
f.Add(-7)
f.Add(31)
f.Add(33)
f.Fuzz(func(t *testing.T, seed int) {
multiAgreementTest(t, seed, honestCount, instanceCount, maxRounds*2, asyncOptions(seed)...)
t.Parallel()
for hc := 2; hc <= maxHonestCount; hc++ {
hc := hc
t.Run(fmt.Sprintf("%d", hc), func(t *testing.T) {
multiAgreementTest(t, seed, hc, instanceCount, maxRounds*4, asyncOptions(seed)...)
})
}
})
}

Expand Down

0 comments on commit 9b03360

Please sign in to comment.