Skip to content

Commit

Permalink
Merge pull request #3223 from lucas-clemente/fix-flaky-invalid-token-…
Browse files Browse the repository at this point in the history
…test

fix flaky INVALID_TOKEN server test
  • Loading branch information
marten-seemann committed Jul 6, 2021
2 parents 99d2a4e + adcb1ea commit 746358c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server_test.go
Expand Up @@ -568,10 +568,12 @@ var _ = Describe("Server", func() {
packet := getPacket(hdr, make([]byte, protocol.MinInitialPacketSize))
packet.data[len(packet.data)-10] ^= 0xff // corrupt the packet
packet.remoteAddr = &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1337}
tracer.EXPECT().DroppedPacket(packet.remoteAddr, logging.PacketTypeInitial, packet.Size(), logging.PacketDropPayloadDecryptError)
done := make(chan struct{})
tracer.EXPECT().DroppedPacket(packet.remoteAddr, logging.PacketTypeInitial, packet.Size(), logging.PacketDropPayloadDecryptError).Do(func(net.Addr, logging.PacketType, protocol.ByteCount, logging.PacketDropReason) { close(done) })
serv.handlePacket(packet)
// make sure there are no Write calls on the packet conn
time.Sleep(50 * time.Millisecond)
Eventually(done).Should(BeClosed())
})

It("creates a session, if no Token is required", func() {
Expand Down

0 comments on commit 746358c

Please sign in to comment.