Skip to content

Commit 1fed223

Browse files
accounts/keystore: fix flaky test (#21703)
* accounts/keystore: add timeout to test to prevent failure on travis The TestWalletNotifications test sporadically fails on travis. This is because we shutdown the event collection before all events are received. Adding a small timeout (10 milliseconds) allows the collector to be scheduled and to consume all pending events before we shut it down. * accounts/keystore: added newlines back in * accounts/keystore: properly fix the walletNotifications test
1 parent 1e10489 commit 1fed223

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

accounts/keystore/keystore_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ func TestWalletNotifications(t *testing.T) {
336336

337337
// Shut down the event collector and check events.
338338
sub.Unsubscribe()
339-
<-updates
339+
for ev := range updates {
340+
events = append(events, walletEvent{ev, ev.Wallet.Accounts()[0]})
341+
}
340342
checkAccounts(t, live, ks.Wallets())
341343
checkEvents(t, wantEvents, events)
342344
}

0 commit comments

Comments
 (0)