From 7e9282db3348a5790960c0d8f3ac21795118f830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=84=E6=B6=A6=E6=A2=93?= <528185299@qq.com> Date: Mon, 24 Jun 2024 14:31:09 +0800 Subject: [PATCH] fix11 --- tests/e2e/greptimedbcluster_baremetal_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/greptimedbcluster_baremetal_test.go b/tests/e2e/greptimedbcluster_baremetal_test.go index 3fdcf72e..d363ed88 100644 --- a/tests/e2e/greptimedbcluster_baremetal_test.go +++ b/tests/e2e/greptimedbcluster_baremetal_test.go @@ -46,7 +46,7 @@ var _ = Describe("Basic test of greptimedb cluster in baremetal", func() { err = getClusterinBaremetal() Expect(err).NotTo(HaveOccurred(), "failed to get cluster in baremetal") - if cmd.Process != nil { + if cmd != nil && cmd.Process != nil { err = cmd.Process.Kill() Expect(err).NotTo(HaveOccurred(), "failed to kill create cluster process") } else { @@ -58,14 +58,14 @@ var _ = Describe("Basic test of greptimedb cluster in baremetal", func() { }) }) -func newCreateClusterinBaremetalCommand() exec.Cmd { +func newCreateClusterinBaremetalCommand() *exec.Cmd { cmd := exec.Command("../../bin/gtctl", "cluster", "create", "mydb", "--bare-metal") cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr - return *cmd + return cmd } -func createClusterinBaremetal(cmd exec.Cmd) error { +func createClusterinBaremetal(cmd *exec.Cmd) error { if err := cmd.Run(); err != nil { return err }