les: use time.After

This commit is contained in:
Felix Lange 2020-03-11 11:34:21 +01:00 committed by GitHub
parent 51881bf76f
commit 8af579824c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -542,8 +542,8 @@ func newClientServerEnv(t *testing.T, blocks int, protocol int, callback indexer
}
select {
case <-done:
case <-time.NewTimer(time.Second * 3).C:
t.Fatal("Timeout")
case <-time.After(3 * time.Second):
t.Fatal("test peer did not connect and sync within 3s")
}
}
s := &testServer{