Skip to content

Commit

Permalink
fix a testleak fail in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao committed Mar 25, 2021
1 parent e8f3544 commit ed96ff8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion session/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ func (s *testBootstrapSuite) TestForIssue23387(c *C) {
// Bootstrap to an old version, create a user.
store, err := mockstore.NewMockStore()
c.Assert(err, IsNil)
defer store.Close()
_, err = BootstrapSession(store)
// domain leaked here, Close() is not called. For testing, it's OK.
// If we close it and BootstrapSession again, we'll get an error "session pool is closed".
Expand All @@ -667,8 +668,9 @@ func (s *testBootstrapSuite) TestForIssue23387(c *C) {

// Upgrade to a newer version, check the user's privilege.
currentBootstrapVersion = saveCurrentBootstrapVersion
_, err = BootstrapSession(store)
dom, err := BootstrapSession(store)
c.Assert(err, IsNil)
defer dom.Close()

se = newSession(c, store, s.dbName)
rs, err := exec(se, "show grants for quatest")
Expand Down

0 comments on commit ed96ff8

Please sign in to comment.