1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Fix flaky tests

This commit is contained in:
Vladimir Mihailenco
2017-08-15 10:34:05 +03:00
parent 63e3bc58c7
commit 8ff417ca18
4 changed files with 28 additions and 15 deletions

View File

@ -400,8 +400,11 @@ var _ = Describe("PubSub", func() {
pubsub := client.Subscribe()
defer pubsub.Close()
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer GinkgoRecover()
defer wg.Done()
time.Sleep(2 * timeout)
@ -418,5 +421,7 @@ var _ = Describe("PubSub", func() {
Expect(err).NotTo(HaveOccurred())
Expect(msg.Channel).To(Equal("mychannel"))
Expect(msg.Payload).To(Equal("hello"))
wg.Wait()
})
})