Skip to content

Commit

Permalink
fix: defer
Browse files Browse the repository at this point in the history
Signed-off-by: ashing <[email protected]>
  • Loading branch information
ronething committed Aug 27, 2023
1 parent 71187c5 commit 9a3dce9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/e2e/broadcast/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ var _ = ginkgo.Describe("CLI", func() {
gomega.Expect(err).Should(gomega.BeNil())
pid := cmd.Process.Pid
gomega.Expect(pid).Should(gomega.BeNumerically(">", 0))
go func() {
time.Sleep(3 * time.Second)
defer func() {
var err error
err = cmd.Process.Signal(syscall.SIGINT)
gomega.Expect(err).Should(gomega.BeNil())
err = cmd.Wait()
Expand All @@ -61,7 +61,7 @@ var _ = ginkgo.Describe("CLI", func() {
err = notifyCmd.Run()
gomega.Expect(err).Should(gomega.BeNil())
// check log
time.Sleep(5 * time.Second)
time.Sleep(2 * time.Second)
gomega.Expect(out.String()).Should(gomega.ContainSubstring("add agent agent_1 region_123456"))
gomega.Expect(out.String()).Should(gomega.ContainSubstring("add agent agent_2 region_123456"))
gomega.Expect(out.String()).Should(gomega.ContainSubstring("key: /config/region_123456 value: value change"))
Expand Down

0 comments on commit 9a3dce9

Please sign in to comment.