From 8c91fa26990a50353c0bdd9e3e985eafb98cc7a0 Mon Sep 17 00:00:00 2001 From: JackDoan Date: Fri, 17 Jul 2026 15:46:41 -0500 Subject: [PATCH] fix it! --- udp/udp_linux_test.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/udp/udp_linux_test.go b/udp/udp_linux_test.go index f9e7b3d8..6815a9ea 100644 --- a/udp/udp_linux_test.go +++ b/udp/udp_linux_test.go @@ -5,10 +5,8 @@ package udp import ( "errors" "fmt" - "log/slog" "net" "net/netip" - "os" "runtime" "sync/atomic" "testing" @@ -17,10 +15,6 @@ import ( "golang.org/x/sys/unix" ) -func testLogger() *slog.Logger { - return slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelError})) -} - // TestShutdownWakesAfterRx_Mechanism exercises the kernel quirk our teardown // relies on: once a socket has received a packet, shutdown(2) wakes a blocked // recvmmsg with n>=1/Len==0 (not n==0). recvmmsg must turn that into net.ErrClosed @@ -35,7 +29,7 @@ func TestShutdownWakesAfterRx_Mechanism(t *testing.T) { if err != nil { t.Fatalf("LocalAddr: %v", err) } - msgs, _, _ := sc.PrepareRawMessages(sc.batch) + msgs, _, _, _ := sc.PrepareRawMessages(sc.batch, 0xffff, 16) // Receive a real packet so the socket has carried data. send, err := net.Dial("udp", addr.String()) @@ -134,9 +128,9 @@ func runTeardownCase(t *testing.T, batch int, name string, traffic func(send net var received atomic.Int64 loopDone := make(chan error, 1) go func() { - loopDone <- sc.ListenOut(func(netip.AddrPort, []byte) { + loopDone <- sc.ListenOut(func(netip.AddrPort, []byte, RxMeta) { received.Add(1) - }) + }, func() {}) }() send, err := net.Dial("udp", addr.String())