good morning!!!!

Skip to content
Snippets Groups Projects
Commit cc2b39bb authored by Anton Evangelatov's avatar Anton Evangelatov Committed by Felix Lange
Browse files

consensus/ethash: increase timeout in test (#17526)

This is an attempt to fix the flaky consensus/ethash tests under macOS.
parent c9a0b36a
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,18 @@ func TestRemoteNotify(t *testing.T) { ...@@ -40,6 +40,18 @@ func TestRemoteNotify(t *testing.T) {
go server.Serve(listener) go server.Serve(listener)
// Wait for server to start listening
var tries int
for tries = 0; tries < 10; tries++ {
conn, _ := net.DialTimeout("tcp", listener.Addr().String(), 1*time.Second)
if conn != nil {
break
}
}
if tries == 10 {
t.Fatal("tcp listener not ready for more than 10 seconds")
}
// Create the custom ethash engine // Create the custom ethash engine
ethash := NewTester([]string{"http://" + listener.Addr().String()}, false) ethash := NewTester([]string{"http://" + listener.Addr().String()}, false)
defer ethash.Close() defer ethash.Close()
...@@ -61,7 +73,7 @@ func TestRemoteNotify(t *testing.T) { ...@@ -61,7 +73,7 @@ func TestRemoteNotify(t *testing.T) {
if want := common.BytesToHash(target.Bytes()).Hex(); work[2] != want { if want := common.BytesToHash(target.Bytes()).Hex(); work[2] != want {
t.Errorf("work packet target mismatch: have %s, want %s", work[2], want) t.Errorf("work packet target mismatch: have %s, want %s", work[2], want)
} }
case <-time.After(time.Second): case <-time.After(3 * time.Second):
t.Fatalf("notification timed out") t.Fatalf("notification timed out")
} }
} }
...@@ -108,7 +120,7 @@ func TestRemoteMultiNotify(t *testing.T) { ...@@ -108,7 +120,7 @@ func TestRemoteMultiNotify(t *testing.T) {
for i := 0; i < cap(sink); i++ { for i := 0; i < cap(sink); i++ {
select { select {
case <-sink: case <-sink:
case <-time.After(250 * time.Millisecond): case <-time.After(3 * time.Second):
t.Fatalf("notification %d timed out", i) t.Fatalf("notification %d timed out", i)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment