Skip to content

Commit

Permalink
fix11
Browse files Browse the repository at this point in the history
  • Loading branch information
庄润梓 committed Jun 24, 2024
1 parent 4e897b6 commit 87ea15b
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions tests/e2e/greptimedbcluster_baremetal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,22 @@ var _ = Describe("Basic test of greptimedb cluster in baremetal", func() {
err = cmd.Start()
Expect(err).NotTo(HaveOccurred(), "failed to create cluster in baremetal")

go func() {
// 轮询检测端口是否连接成功
for {
if conn, err := net.DialTimeout("tcp", "localhost:4000", 2*time.Second); err == nil {
defer conn.Close()
break
}
for {
if conn, err := net.DialTimeout("tcp", "localhost:4000", 2*time.Second); err == nil {
defer conn.Close()
break
}
}

err = getClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to get cluster in baremetal")
err = getClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to get cluster in baremetal")

if cmd.Process != nil {
err = cmd.Process.Kill()
Expect(err).NotTo(HaveOccurred(), "failed to kill create cluster process")
} else {
Fail("process is not properly initialized")
}
}()
if cmd.Process != nil {
err = cmd.Process.Kill()
Expect(err).NotTo(HaveOccurred(), "failed to kill create cluster process")
} else {
Fail("process is not properly initialized")
}

err = deleteClusterinBaremetal()
Expect(err).NotTo(HaveOccurred(), "failed to delete cluster in baremetal")
Expand Down

0 comments on commit 87ea15b

Please sign in to comment.