transport: fix flaky stateless reset test (#3810)

This commit is contained in:
Marten Seemann 2023-05-08 10:56:59 +02:00 committed by GitHub
parent 22d6b0e626
commit da198b710b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -235,13 +235,16 @@ var _ = Describe("Transport", func() {
Expect(err).ToNot(HaveOccurred())
b = append(b, token[:]...)
conn := NewMockPacketHandler(mockCtrl)
destroyed := make(chan struct{})
gomock.InOrder(
phm.EXPECT().GetByResetToken(token).Return(conn, true),
conn.EXPECT().destroy(gomock.Any()).Do(func(err error) {
Expect(err).To(MatchError(&StatelessResetError{Token: token}))
close(destroyed)
}),
)
packetChan <- packetToRead{data: b}
Eventually(destroyed).Should(BeClosed())
// shutdown
phm.EXPECT().Close(gomock.Any())