use synctest for the packet drop test (#5393)

This commit is contained in:
Marten Seemann
2025-10-21 16:28:11 +02:00
committed by GitHub
parent c0611d2f56
commit 756bdc0104
3 changed files with 105 additions and 74 deletions

View File

@@ -0,0 +1,18 @@
package self_test
import "github.com/quic-go/quic-go/testutils/simnet"
type droppingRouter struct {
simnet.PerfectRouter
Drop func(simnet.Packet) bool
}
func (d *droppingRouter) SendPacket(p simnet.Packet) error {
if d.Drop(p) {
return nil
}
return d.PerfectRouter.SendPacket(p)
}
var _ simnet.Router = &droppingRouter{}