expose a StatelessResetError

This commit is contained in:
Marten Seemann 2021-04-25 19:10:15 +07:00
parent 1ce572228b
commit 93cfef57ca
8 changed files with 53 additions and 24 deletions

View file

@ -373,10 +373,10 @@ var _ = Describe("Packet Handler Map", func() {
defer GinkgoRecover()
defer close(destroyed)
Expect(err).To(HaveOccurred())
var resetErr *statelessResetErr
var resetErr *StatelessResetError
Expect(errors.As(err, &resetErr)).To(BeTrue())
Expect(err.Error()).To(ContainSubstring("received a stateless reset"))
Expect(resetErr.token).To(Equal(token))
Expect(resetErr.Token).To(Equal(token))
})
packetChan <- packetToRead{data: packet}
Eventually(destroyed).Should(BeClosed())
@ -393,10 +393,10 @@ var _ = Describe("Packet Handler Map", func() {
packetHandler.EXPECT().destroy(gomock.Any()).Do(func(err error) {
defer GinkgoRecover()
Expect(err).To(HaveOccurred())
var resetErr *statelessResetErr
var resetErr *StatelessResetError
Expect(errors.As(err, &resetErr)).To(BeTrue())
Expect(err.Error()).To(ContainSubstring("received a stateless reset"))
Expect(resetErr.token).To(Equal(token))
Expect(resetErr.Token).To(Equal(token))
close(destroyed)
})
packetChan <- packetToRead{data: packet}