diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index 0ac780ff81..1d32880325 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -97,7 +97,7 @@ func runGeth(t *testing.T, args ...string) *testgeth { // waitForEndpoint attempts to connect to an RPC endpoint until it succeeds. func waitForEndpoint(t *testing.T, endpoint string, timeout time.Duration) { probe := func() bool { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() c, err := rpc.DialContext(ctx, endpoint) if c != nil {