les, miner, accounts/abi/bind: fix load-sensitive unit tests (#20698)

This commit is contained in:
gary rong
2020-02-20 20:05:54 +08:00
committed by GitHub
parent 6df973df27
commit 2e1ecc02bd
3 changed files with 13 additions and 7 deletions

View File

@ -517,7 +517,7 @@ func TestNodeDBExpiration(t *testing.T) {
for _, c := range cases {
ndb.setNB(c.ip, c.balance)
}
time.Sleep(100 * time.Millisecond) // Ensure the db expirer is registered.
clock.WaitForTimers(1)
clock.Run(time.Hour + time.Minute)
select {
case <-done:
@ -527,7 +527,7 @@ func TestNodeDBExpiration(t *testing.T) {
if iterated != 4 {
t.Fatalf("Failed to evict useless negative balances, want %v, got %d", 4, iterated)
}
clock.WaitForTimers(1)
for _, c := range cases {
ndb.setNB(c.ip, c.balance)
}