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.
This commit is contained in:
Delweng 2023-05-22 20:13:03 +08:00 committed by GitHub
parent 944e1a0f90
commit 6fe0252571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -116,7 +116,7 @@ func TestAttachWelcome(t *testing.T) {
waitForEndpoint(t, endpoint, 3*time.Second) waitForEndpoint(t, endpoint, 3*time.Second)
testAttachWelcome(t, geth, endpoint, httpAPIs) testAttachWelcome(t, geth, endpoint, httpAPIs)
}) })
geth.ExpectExit() geth.Kill()
} }
func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) {

View File

@ -237,7 +237,7 @@ func (tt *TestCmd) Kill() {
} }
func (tt *TestCmd) withKillTimeout(fn func()) { 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.Log("killing the child process (timeout)")
tt.Kill() tt.Kill()
}) })

View File

@ -43,7 +43,7 @@ var (
const ( const (
// Timeouts // Timeouts
defaultDialTimeout = 10 * time.Second // used if context has no deadline 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 ( const (