From 42bf68205c10026f47c72ecb25042b29b504eaac Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 28 Feb 2020 16:48:15 +0700 Subject: [PATCH] fix flaky session unit test --- session_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/session_test.go b/session_test.go index 90da9ea4f..5fe41ef37 100644 --- a/session_test.go +++ b/session_test.go @@ -1307,8 +1307,11 @@ var _ = Describe("Session", func() { Consistently(handshakeCtx.Done()).ShouldNot(BeClosed()) mconn.EXPECT().RemoteAddr().Return(&net.UDPAddr{}) // the remote addr is needed for the token close(finishHandshake) - Eventually(handshakeCtx.Done()).Should(BeClosed()) - frames, _ := sess.framer.AppendControlFrames(nil, protocol.MaxByteCount) + var frames []ackhandler.Frame + Eventually(func() []ackhandler.Frame { + frames, _ = sess.framer.AppendControlFrames(nil, protocol.MaxByteCount) + return frames + }).ShouldNot(BeEmpty()) var count int var s int for _, f := range frames {