diff --git a/lntest/harness.go b/lntest/harness.go index 600c7b02f..f53050092 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -1035,8 +1035,12 @@ func (n *NetworkHarness) AssertChannelExists(ctx context.Context, // several running lnd nodes. This function gives callers a way to assert that // some property is upheld within a particular time frame. func WaitPredicate(pred func() bool, timeout time.Duration) error { + const pollInterval = 20 * time.Millisecond + exitTimer := time.After(timeout) for { + <-time.After(pollInterval) + select { case <-exitTimer: return fmt.Errorf("predicate not satisfied after time out")