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:
@ -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"))
|
||||
|
Reference in New Issue
Block a user