From 6fe0252571537227001a4f861f31cf5163a68b4f 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 46bdf3c90d..5046906c0a 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 fd7a4a8b7f..df5107952e 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 fbeb5a1814..fae8536b26 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 (