test: fix flake in testInvoiceRoutingHints by using WaitPredicate
This commit is contained in:
parent
8712ab110d
commit
d50247304b
14
lnd_test.go
14
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.
|
||||||
if len(decoded.RouteHints) != 1 {
|
var predErr error
|
||||||
t.Fatalf("expected one route hint, got %d",
|
err = lntest.WaitPredicate(func() bool {
|
||||||
len(decoded.RouteHints))
|
if len(decoded.RouteHints) != 1 {
|
||||||
|
predErr = fmt.Errorf("expected one route hint, got %d",
|
||||||
|
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