Skip to content

Commit

Permalink
util: fix a test leak in testPrefixSuite (pingcap#5122)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored and shenli committed Nov 16, 2017
1 parent e96aded commit 11358f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/prefix_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type testPrefixSuite struct {
}

func (s *testPrefixSuite) SetUpSuite(c *C) {
testleak.BeforeTest()
store, err := tikv.NewMockTikvStore()
c.Assert(err, IsNil)
s.s = store
Expand All @@ -52,6 +53,7 @@ func (s *testPrefixSuite) SetUpSuite(c *C) {
func (s *testPrefixSuite) TearDownSuite(c *C) {
err := s.s.Close()
c.Assert(err, IsNil)
testleak.AfterTest(c)()
}

func encodeInt(n int) []byte {
Expand Down Expand Up @@ -113,7 +115,6 @@ func (c *MockContext) CommitTxn() error {
}

func (s *testPrefixSuite) TestPrefix(c *C) {
defer testleak.AfterTest(c)()
ctx := &MockContext{10000000, make(map[fmt.Stringer]interface{}), s.s, nil}
ctx.fillTxn()
txn, err := ctx.GetTxn(false)
Expand All @@ -137,7 +138,6 @@ func (s *testPrefixSuite) TestPrefix(c *C) {
}

func (s *testPrefixSuite) TestPrefixFilter(c *C) {
defer testleak.AfterTest(c)()
rowKey := []byte("test@#$%l(le[0]..prefix) 2uio")
rowKey[8] = 0x00
rowKey[9] = 0x00
Expand Down

0 comments on commit 11358f6

Please sign in to comment.