diff --git a/send_queue.go b/send_queue.go index 4d31a276..bf25dded 100644 --- a/send_queue.go +++ b/send_queue.go @@ -18,7 +18,7 @@ type sendQueue struct { var _ sender = &sendQueue{} -const sendQueueCapacity = 1 +const sendQueueCapacity = 8 func newSendQueue(conn sendConn) sender { return &sendQueue{ diff --git a/send_queue_test.go b/send_queue_test.go index 416c264b..dc3179c4 100644 --- a/send_queue_test.go +++ b/send_queue_test.go @@ -43,10 +43,12 @@ var _ = Describe("Send Queue", func() { }) It("panics when Send() is called although there's no space in the queue", func() { - Expect(q.WouldBlock()).To(BeFalse()) - q.Send(getPacket([]byte("foobar1"))) + for i := 0; i < sendQueueCapacity; i++ { + Expect(q.WouldBlock()).To(BeFalse()) + q.Send(getPacket([]byte("foobar"))) + } Expect(q.WouldBlock()).To(BeTrue()) - Expect(func() { q.Send(getPacket([]byte("foobar2"))) }).To(Panic()) + Expect(func() { q.Send(getPacket([]byte("raboof"))) }).To(Panic()) }) It("signals when sending is possible again", func() {