Skip to content

Commit

Permalink
tests: fix leak test in embeded etcd test (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei authored Jun 5, 2021
1 parent 8983126 commit 7f01111
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/etcd/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ func (s *etcdSuite) SetUpTest(c *check.C) {
c.Assert(err, check.IsNil)
s.clientURL = curl
s.etcd = e
go func() {
c.Log(<-e.Err())
}()
}

func (s *etcdSuite) TearDownTest(c *check.C) {
s.etcd.Close()
logEtcdError:
for {
select {
case err := <-s.etcd.Err():
c.Logf("etcd server error: %v", err)
default:
break logEtcdError
}
}
}

func (s *etcdSuite) TestEmbedEtcd(c *check.C) {
Expand Down

0 comments on commit 7f01111

Please sign in to comment.