1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +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

@ -2,6 +2,7 @@ package redis_test
import (
"net"
"sync"
"time"
. "github.com/onsi/ginkgo"
@ -261,19 +262,23 @@ var _ = Describe("PubSub", func() {
writeErr: errTimeout,
})
var wg sync.WaitGroup
wg.Add(1)
go func() {
defer GinkgoRecover()
defer wg.Done()
time.Sleep(100 * time.Millisecond)
n, err := client.Publish("mychannel", "hello").Result()
err := client.Publish("mychannel", "hello").Err()
Expect(err).NotTo(HaveOccurred())
Expect(n).To(Equal(int64(2)))
}()
msg, err := pubsub.ReceiveMessage()
Expect(err).NotTo(HaveOccurred())
Expect(msg.Channel).To(Equal("mychannel"))
Expect(msg.Payload).To(Equal("hello"))
wg.Wait()
})
})