fix flaky version negotiation connection unit test (#4052)

This commit is contained in:
Marten Seemann
2023-08-27 11:53:07 +07:00
committed by GitHub
parent 8963306987
commit 8f34488c76

View File

@@ -2702,8 +2702,9 @@ var _ = Describe("Client Connection", func() {
Expect(recreateErr.nextPacketNumber).To(Equal(protocol.PacketNumber(128)))
})
It("it closes when no matching version is found", func() {
It("closes when no matching version is found", func() {
errChan := make(chan error, 1)
packer.EXPECT().PackCoalescedPacket(gomock.Any(), gomock.Any(), gomock.Any()).MaxTimes(1)
go func() {
defer GinkgoRecover()
cryptoSetup.EXPECT().StartHandshake().MaxTimes(1)
@@ -2711,7 +2712,6 @@ var _ = Describe("Client Connection", func() {
errChan <- conn.run()
}()
connRunner.EXPECT().Remove(srcConnID).MaxTimes(1)
packer.EXPECT().PackCoalescedPacket(gomock.Any(), gomock.Any(), gomock.Any()).MaxTimes(1)
gomock.InOrder(
tracer.EXPECT().ReceivedVersionNegotiationPacket(gomock.Any(), gomock.Any(), gomock.Any()),
tracer.EXPECT().ClosedConnection(gomock.Any()).Do(func(e error) {