From aa566d7ead92d71dd359d56dbe3096485fc713e7 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Wed, 6 Nov 2019 12:04:07 +0800 Subject: [PATCH] les: loose restriction of unit tests --- les/clientpool_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/les/clientpool_test.go b/les/clientpool_test.go index 5b9494c2aa..af75d7bbda 100644 --- a/les/clientpool_test.go +++ b/les/clientpool_test.go @@ -308,9 +308,9 @@ func TestFreeClientKickedOut(t *testing.T) { for i := 0; i < 10; i++ { pool.connect(poolTestPeer(i), 1) - clock.Run(100 * time.Millisecond) + clock.Run(time.Millisecond) } - if pool.connect(poolTestPeer(11), 1) { + if pool.connect(poolTestPeer(10), 1) { t.Fatalf("New free client should be rejected") } clock.Run(5 * time.Minute) @@ -320,8 +320,8 @@ func TestFreeClientKickedOut(t *testing.T) { for i := 0; i < 10; i++ { select { case id := <-kicked: - if id != i { - t.Fatalf("Kicked client mismatch, want %v, got %v", i, id) + if id >= 10 { + t.Fatalf("Old client should be kicked, now got: %d", id) } case <-time.NewTimer(time.Second).C: t.Fatalf("timeout")