From cebac05d4c6a66622667ed7a5808eaeb9857040f Mon Sep 17 00:00:00 2001 From: Delweng Date: Mon, 22 May 2023 20:13:03 +0800 Subject: [PATCH] rpc, internal/cmdtest: increase timeout in tests (#27083) This change gives the cmd-tests have a bit more time to finish before getting forcibly torn down. --- cmd/geth/consolecmd_test.go | 2 +- internal/cmdtest/test_cmd.go | 2 +- rpc/client.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index 46bdf3c90d9f..5046906c0a9c 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -116,7 +116,7 @@ func TestAttachWelcome(t *testing.T) { waitForEndpoint(t, endpoint, 3*time.Second) testAttachWelcome(t, geth, endpoint, httpAPIs) }) - geth.ExpectExit() + geth.Kill() } func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { diff --git a/internal/cmdtest/test_cmd.go b/internal/cmdtest/test_cmd.go index fd7a4a8b7f4c..df5107952e51 100644 --- a/internal/cmdtest/test_cmd.go +++ b/internal/cmdtest/test_cmd.go @@ -237,7 +237,7 @@ func (tt *TestCmd) Kill() { } func (tt *TestCmd) withKillTimeout(fn func()) { - timeout := time.AfterFunc(5*time.Second, func() { + timeout := time.AfterFunc(30*time.Second, func() { tt.Log("killing the child process (timeout)") tt.Kill() }) diff --git a/rpc/client.go b/rpc/client.go index fbeb5a18148d..fae8536b26d8 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -43,7 +43,7 @@ var ( const ( // Timeouts defaultDialTimeout = 10 * time.Second // used if context has no deadline - subscribeTimeout = 5 * time.Second // overall timeout eth_subscribe, rpc_modules calls + subscribeTimeout = 10 * time.Second // overall timeout eth_subscribe, rpc_modules calls ) const (