From d3974e167402648b7d14f2948a7c007e03e5fe07 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 25 Jan 2024 00:53:20 -0800 Subject: [PATCH] fix flaky handshake limiting test (#4270) --- server_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server_test.go b/server_test.go index d0319eb8..23e06257 100644 --- a/server_test.go +++ b/server_test.go @@ -807,12 +807,17 @@ var _ = Describe("Server", func() { _, err := serv.Accept(context.Background()) Expect(err).ToNot(HaveOccurred()) } + // make sure we can enqueue and accept more connections after that for i := 0; i < limit; i++ { conn := NewMockQUICConn(mockCtrl) conn.EXPECT().closeWithTransportError(gomock.Any()).MaxTimes(1) // called when the server is closed connChan <- conn serv.handlePacket(getInitialWithRandomDestConnID()) } + for i := 0; i < limit; i++ { + _, err := serv.Accept(context.Background()) + Expect(err).ToNot(HaveOccurred()) + } }) })