Skip to content

Commit 44e6844

Browse files
committed
tapgarden: extend time window for expected DeriveNextKey calls
Increase the allowed time window during which the expected number of DeriveNextKey calls can occur. This helps accommodate timing variations and reduces test flakiness.
1 parent 2102fdb commit 44e6844

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tapgarden/planter_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,18 @@ func (t *mintingTestHarness) queueSeedlingsInBatch(isFunded bool,
309309
// The received update should be a state of MintingStateSeed.
310310
require.Equal(t, tapgarden.MintingStateSeed, update.NewState)
311311

312-
t.keyRing.AssertNumberOfCalls(t, "DeriveNextKey", keyCount)
312+
require.Eventually(t, func() bool {
313+
// Assert that the key ring method DeriveNextKey was
314+
// called the expected number of times.
315+
count := 0
316+
for _, call := range t.keyRing.Calls {
317+
if call.Method == "DeriveNextKey" {
318+
count++
319+
}
320+
}
321+
322+
return count == keyCount
323+
}, defaultTimeout, wait.PollInterval)
313324
}
314325
}
315326

0 commit comments

Comments
 (0)