Skip to content

Commit

Permalink
Move pool object to the test itself
Browse files Browse the repository at this point in the history
  • Loading branch information
xin-tsla committed Jun 20, 2023
1 parent 62d7cd2 commit 9653a28
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions internal/pool/pool_single_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ import (
)

var _ = Describe("SingleConnPool", func() {
var p *pool.SingleConnPool

BeforeEach(func() {
p = pool.NewSingleConnPool(nil, &pool.Conn{})
})

It("remove a conn due to context is cancelled", func() {
p := pool.NewSingleConnPool(nil, &pool.Conn{})
ctx, cl := context.WithCancel(context.TODO())
cn, err := p.Get(nil)
Expect(err).To(BeNil())
Expand All @@ -27,5 +22,4 @@ var _ = Describe("SingleConnPool", func() {
Expect(cn).To(BeNil())
Expect(err).ToNot(BeNil())
})

})

0 comments on commit 9653a28

Please sign in to comment.