1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Fix test.

This commit is contained in:
Vladimir Mihailenco
2015-11-22 14:44:38 +02:00
parent f130ab6161
commit b6b689904a
6 changed files with 36 additions and 29 deletions

View File

@ -20,10 +20,8 @@ var _ = Describe("Commands", func() {
BeforeEach(func() {
client = redis.NewClient(&redis.Options{
Addr: redisAddr,
ReadTimeout: 500 * time.Millisecond,
WriteTimeout: 500 * time.Millisecond,
PoolTimeout: 30 * time.Second,
Addr: redisAddr,
PoolTimeout: 30 * time.Second,
})
})
@ -81,13 +79,10 @@ var _ = Describe("Commands", func() {
err := client.ClientPause(time.Second).Err()
Expect(err).NotTo(HaveOccurred())
Consistently(func() error {
return client.Ping().Err()
}, "400ms").Should(HaveOccurred()) // pause time - read timeout
Eventually(func() error {
return client.Ping().Err()
}, "1s").ShouldNot(HaveOccurred())
start := time.Now()
err = client.Ping().Err()
Expect(err).NotTo(HaveOccurred())
Expect(time.Now()).To(BeTemporally("~", start.Add(time.Second), 800*time.Millisecond))
})
It("should ClientSetName and ClientGetName", func() {