mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Add race test for big vals. Copy connection to avoid race with PubSub.
This commit is contained in:
@ -31,12 +31,14 @@ var _ = Describe("conns reapser", func() {
|
||||
cn := pool.NewConn(&net.TCPConn{})
|
||||
cn.UsedAt = time.Now().Add(-2 * time.Minute)
|
||||
Expect(connPool.Add(cn)).To(BeTrue())
|
||||
Expect(cn.Index()).To(Equal(i))
|
||||
}
|
||||
|
||||
// add fresh connections
|
||||
for i := 0; i < 3; i++ {
|
||||
cn := pool.NewConn(&net.TCPConn{})
|
||||
Expect(connPool.Add(cn)).To(BeTrue())
|
||||
Expect(cn.Index()).To(Equal(3 + i))
|
||||
}
|
||||
|
||||
Expect(connPool.Len()).To(Equal(6))
|
||||
|
Reference in New Issue
Block a user