replace the sync.Cond for stream.Read() by a channel

This commit is contained in:
Marten Seemann 2017-04-15 12:13:12 +07:00
parent bd693193ed
commit 5fbd52158f
2 changed files with 21 additions and 14 deletions

View file

@ -135,11 +135,9 @@ var _ = Describe("Stream", func() {
mockFcm.EXPECT().UpdateHighestReceived(streamID, protocol.ByteCount(2))
mockFcm.EXPECT().AddBytesRead(streamID, protocol.ByteCount(2))
go func() {
frame := frames.StreamFrame{
Offset: 0,
Data: []byte{0xDE, 0xAD},
}
time.Sleep(time.Millisecond)
defer GinkgoRecover()
frame := frames.StreamFrame{Data: []byte{0xDE, 0xAD}}
time.Sleep(10 * time.Millisecond)
err := str.AddStreamFrame(&frame)
Expect(err).ToNot(HaveOccurred())
}()