mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
fix flaky drop tests by working around the div-nonce type byte issue
hopefully fixes #243
This commit is contained in:
parent
62b06a003c
commit
095f32ec53
2 changed files with 11 additions and 9 deletions
|
@ -43,7 +43,7 @@ var _ = Describe("Drop Proxy", func() {
|
|||
"https://quic.clemente.io/data",
|
||||
)
|
||||
|
||||
session, err := Start(command, nil, GinkgoWriter)
|
||||
session, err := Start(command, GinkgoWriter, GinkgoWriter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
defer session.Kill()
|
||||
Eventually(session, 4).Should(Exit(0))
|
||||
|
@ -61,7 +61,7 @@ var _ = Describe("Drop Proxy", func() {
|
|||
Context(fmt.Sprintf("with quic version %d", version), func() {
|
||||
Context("dropping every 4th packet after the crypto handshake", func() {
|
||||
dropper := func(p protocol.PacketNumber) bool {
|
||||
if p <= 5 { // don't interfere with the crypto handshake
|
||||
if p <= 10 { // don't interfere with the crypto handshake
|
||||
return false
|
||||
}
|
||||
return p%4 == 0
|
||||
|
|
|
@ -151,15 +151,17 @@ func (p *UDPProxy) runConnection(conn *connection) error {
|
|||
}
|
||||
|
||||
raw := buffer[0:n]
|
||||
r := bytes.NewReader(raw)
|
||||
hdr, err := quic.ParsePublicHeader(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
atomic.AddUint64(&conn.outgoingPacketCounter, 1)
|
||||
// TODO: Switch back to using the public header once Chrome properly sets the type byte.
|
||||
// r := bytes.NewReader(raw)
|
||||
// , err := quic.ParsePublicHeader(r)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
if !p.dropOutgoingPacket(hdr.PacketNumber) {
|
||||
v := atomic.AddUint64(&conn.outgoingPacketCounter, 1)
|
||||
|
||||
if !p.dropOutgoingPacket(protocol.PacketNumber(v)) {
|
||||
// Relay it to client
|
||||
go func() {
|
||||
time.Sleep(p.rttGen.getRTT() / 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue