Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc,internal/cmdtest: increase timeout in tests #27083

Merged
merged 3 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/geth/consolecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmdtest/test_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down
2 changes: 1 addition & 1 deletion rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks like it not only concerns tests, but actually modifies production code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, BTW, it's strange that the dial timeout is set to 10 seconds, but the subscribe timeout is only set to 5 seconds. So I set it to the same as dial's.

)

const (
Expand Down