test: fix flake in testInvoiceRoutingHints by using WaitPredicate
This commit is contained in:
parent
8712ab110d
commit
d50247304b
10
lnd_test.go
10
lnd_test.go
@ -3448,9 +3448,17 @@ func testInvoiceRoutingHints(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
|
|
||||||
// Due to the way the channels were set up above, the channel between
|
// Due to the way the channels were set up above, the channel between
|
||||||
// Alice and Bob should be the only channel used as a routing hint.
|
// Alice and Bob should be the only channel used as a routing hint.
|
||||||
|
var predErr error
|
||||||
|
err = lntest.WaitPredicate(func() bool {
|
||||||
if len(decoded.RouteHints) != 1 {
|
if len(decoded.RouteHints) != 1 {
|
||||||
t.Fatalf("expected one route hint, got %d",
|
predErr = fmt.Errorf("expected one route hint, got %d",
|
||||||
len(decoded.RouteHints))
|
len(decoded.RouteHints))
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}, time.Second*15)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf(predErr.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
hops := decoded.RouteHints[0].HopHints
|
hops := decoded.RouteHints[0].HopHints
|
||||||
|
Loading…
Reference in New Issue
Block a user