fix flaky handshake limiting test (#4270)

This commit is contained in:
Marten Seemann
2024-01-25 00:53:20 -08:00
committed by GitHub
parent baeec0f41c
commit d3974e1674

View File

@@ -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())
}
})
})