itest: wrap assertTxLabel inside wait

This commit is contained in:
yyforyongyu committed 2022-11-17 20:29:50 +08:00
1 parent bbe69f1bd3
commit d39303f246
2 files changed
+32 -7

No files matched your search

+3
View File
@@ -13,6 +13,9 @@ const PollInterval = 200 * time.Millisecond
// timing doesn't always line up well when running integration tests with
// several running lnd nodes. This function gives callers a way to assert that
// some property is upheld within a particular time frame.
//
// TODO(yy): build a counter here so we know how many times we've tried the
// `pred`.
func Predicate(pred func() bool, timeout time.Duration) error {
exitTimer := time.After(timeout)
result := make(chan bool, 1)