diff --git a/test/e2e/pkg/infra/docker/docker.go b/test/e2e/pkg/infra/docker/docker.go index 19a2934aa..03c19cacf 100644 --- a/test/e2e/pkg/infra/docker/docker.go +++ b/test/e2e/pkg/infra/docker/docker.go @@ -110,6 +110,6 @@ func ExecComposeVerbose(ctx context.Context, dir string, args ...string) error { } // Exec runs a Docker command. -func Exec(args ...string) error { - return exec.Command(context.Background(), append([]string{"docker"}, args...)...) +func Exec(ctx context.Context, args ...string) error { + return exec.Command(ctx, append([]string{"docker"}, args...)...) } diff --git a/test/e2e/runner/cleanup.go b/test/e2e/runner/cleanup.go index 5df402be8..2cc7f9b68 100644 --- a/test/e2e/runner/cleanup.go +++ b/test/e2e/runner/cleanup.go @@ -72,8 +72,8 @@ func cleanupDir(dir string) error { if err != nil { return err } - err = docker.Exec("run", "--rm", "--entrypoint", "", "-v", fmt.Sprintf("%v:/network", absDir), - "tendermint/e2e-node", "sh", "-c", "rm -rf /network/*/") + err = docker.Exec(context.Background(), "run", "--rm", "--entrypoint", "", "-v", fmt.Sprintf("%v:/network", absDir), + "tendermint/e2e-node", "sh", "-c", "rm -rf /network/*/") if err != nil { return err } diff --git a/test/e2e/runner/perturb.go b/test/e2e/runner/perturb.go index bab66680b..dfd0ff8b7 100644 --- a/test/e2e/runner/perturb.go +++ b/test/e2e/runner/perturb.go @@ -32,11 +32,11 @@ func PerturbNode(node *e2e.Node, perturbation e2e.Perturbation) (*rpctypes.Resul switch perturbation { case e2e.PerturbationDisconnect: logger.Info("perturb node", "msg", log.NewLazySprintf("Disconnecting node %v...", node.Name)) - if err := docker.Exec("network", "disconnect", testnet.Name+"_"+testnet.Name, node.Name); err != nil { + if err := docker.Exec(context.Background(), "network", "disconnect", testnet.Name+"_"+testnet.Name, node.Name) ; err != nil { return nil, err } time.Sleep(10 * time.Second) - if err := docker.Exec("network", "connect", testnet.Name+"_"+testnet.Name, node.Name); err != nil { + if err := docker.Exec(context.Background(), "network", "connect", testnet.Name+"_"+testnet.Name, node.Name) ; err != nil { return nil, err }