mirror of https://github.com/go-redis/redis.git
Merge pull request #68 from go-redis/fix/relax-pool-test-conditions
Relax pool test conditions.
This commit is contained in:
commit
c66f542b4f
28
pool_test.go
28
pool_test.go
|
@ -39,6 +39,7 @@ var _ = Describe("Pool", func() {
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(val).To(Equal("PONG"))
|
Expect(val).To(Equal("PONG"))
|
||||||
})
|
})
|
||||||
|
|
||||||
pool := client.Pool()
|
pool := client.Pool()
|
||||||
Expect(pool.Size()).To(BeNumerically("<=", 10))
|
Expect(pool.Size()).To(BeNumerically("<=", 10))
|
||||||
Expect(pool.Len()).To(BeNumerically("<=", 10))
|
Expect(pool.Len()).To(BeNumerically("<=", 10))
|
||||||
|
@ -61,8 +62,10 @@ var _ = Describe("Pool", func() {
|
||||||
Expect(multi.Close()).NotTo(HaveOccurred())
|
Expect(multi.Close()).NotTo(HaveOccurred())
|
||||||
})
|
})
|
||||||
|
|
||||||
Expect(client.Pool().Size()).To(Equal(10))
|
pool := client.Pool()
|
||||||
Expect(client.Pool().Len()).To(Equal(10))
|
Expect(pool.Size()).To(BeNumerically("<=", 10))
|
||||||
|
Expect(pool.Len()).To(BeNumerically("<=", 10))
|
||||||
|
Expect(pool.Size()).To(Equal(pool.Len()))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should respect max on pipelines", func() {
|
It("should respect max on pipelines", func() {
|
||||||
|
@ -77,8 +80,10 @@ var _ = Describe("Pool", func() {
|
||||||
Expect(pipe.Close()).NotTo(HaveOccurred())
|
Expect(pipe.Close()).NotTo(HaveOccurred())
|
||||||
})
|
})
|
||||||
|
|
||||||
Expect(client.Pool().Size()).To(Equal(10))
|
pool := client.Pool()
|
||||||
Expect(client.Pool().Len()).To(Equal(10))
|
Expect(pool.Size()).To(BeNumerically("<=", 10))
|
||||||
|
Expect(pool.Len()).To(BeNumerically("<=", 10))
|
||||||
|
Expect(pool.Size()).To(Equal(pool.Len()))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should respect max on pubsub", func() {
|
It("should respect max on pubsub", func() {
|
||||||
|
@ -88,8 +93,9 @@ var _ = Describe("Pool", func() {
|
||||||
Expect(pubsub.Close()).NotTo(HaveOccurred())
|
Expect(pubsub.Close()).NotTo(HaveOccurred())
|
||||||
})
|
})
|
||||||
|
|
||||||
Expect(client.Pool().Size()).To(Equal(0))
|
pool := client.Pool()
|
||||||
Expect(client.Pool().Len()).To(Equal(0))
|
Expect(pool.Size()).To(Equal(0))
|
||||||
|
Expect(pool.Len()).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should remove broken connections", func() {
|
It("should remove broken connections", func() {
|
||||||
|
@ -106,8 +112,9 @@ var _ = Describe("Pool", func() {
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(val).To(Equal("PONG"))
|
Expect(val).To(Equal("PONG"))
|
||||||
|
|
||||||
Expect(client.Pool().Size()).To(Equal(1))
|
pool := client.Pool()
|
||||||
Expect(client.Pool().Len()).To(Equal(1))
|
Expect(pool.Size()).To(Equal(1))
|
||||||
|
Expect(pool.Len()).To(Equal(1))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("should reuse connections", func() {
|
It("should reuse connections", func() {
|
||||||
|
@ -117,8 +124,9 @@ var _ = Describe("Pool", func() {
|
||||||
Expect(val).To(Equal("PONG"))
|
Expect(val).To(Equal("PONG"))
|
||||||
}
|
}
|
||||||
|
|
||||||
Expect(client.Pool().Size()).To(Equal(1))
|
pool := client.Pool()
|
||||||
Expect(client.Pool().Len()).To(Equal(1))
|
Expect(pool.Size()).To(Equal(1))
|
||||||
|
Expect(pool.Len()).To(Equal(1))
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue