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

Fix race in tests.

This commit is contained in:
Vladimir Mihailenco
2016-04-09 11:34:40 +03:00
parent b351402995
commit 787609d1e6
3 changed files with 9 additions and 8 deletions

View File

@ -256,8 +256,7 @@ var _ = Describe("PubSub", func() {
})
It("should ReceiveMessage after timeout", func() {
timeout := time.Second
redis.SetReceiveMessageTimeout(timeout)
timeout := 100 * time.Millisecond
pubsub, err := client.Subscribe("mychannel")
Expect(err).NotTo(HaveOccurred())
@ -276,7 +275,7 @@ var _ = Describe("PubSub", func() {
Expect(n).To(Equal(int64(1)))
}()
msg, err := pubsub.ReceiveMessage()
msg, err := pubsub.ReceiveMessageTimeout(timeout)
Expect(err).NotTo(HaveOccurred())
Expect(msg.Channel).To(Equal("mychannel"))
Expect(msg.Payload).To(Equal("hello"))