Skip to content

Commit 615b617

Browse files
committed
routing: add test for fuzz test special case
This test demonstrates an error found in a fuzz test by adding a previously found seed, which will be fixed in an upcoming commit. The following fuzz test is expected to fail: go test -v -fuzz=Prob ./routing/
1 parent 04eec71 commit 615b617

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

routing/probability_bimodal_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,21 @@ func FuzzProbability(f *testing.F) {
690690
BimodalConfig: BimodalConfig{BimodalScaleMsat: 400_000},
691691
}
692692

693+
// Predefined seed reported in
694+
// https://github.com/lightningnetwork/lnd/issues/9085. This test found
695+
// a case where we could not compute a normalization factor because we
696+
// learned that the balance lies somewhere in the middle of the channel,
697+
// a surprising result for the bimodal model, which predicts two
698+
// distinct modes at the edges and therefore has numerical issues in the
699+
// middle. Additionally, the scale is small with respect to the values
700+
// used here.
701+
f.Add(
702+
uint64(1_000_000_000),
703+
uint64(300_000_000),
704+
uint64(400_000_000),
705+
uint64(300_000_000),
706+
)
707+
693708
f.Fuzz(func(t *testing.T, capacity, successAmt, failAmt, amt uint64) {
694709
if capacity == 0 {
695710
return

0 commit comments

Comments
 (0)