Skip to content

Commit 9b37b20

Browse files
committed
fix it!
1 parent c8bad57 commit 9b37b20

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

udp/udp_linux_test.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ package udp
55
import (
66
"errors"
77
"fmt"
8-
"log/slog"
98
"net"
109
"net/netip"
11-
"os"
1210
"runtime"
1311
"sync/atomic"
1412
"testing"
@@ -17,10 +15,6 @@ import (
1715
"golang.org/x/sys/unix"
1816
)
1917

20-
func testLogger() *slog.Logger {
21-
return slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelError}))
22-
}
23-
2418
// TestShutdownWakesAfterRx_Mechanism exercises the kernel quirk our teardown
2519
// relies on: once a socket has received a packet, shutdown(2) wakes a blocked
2620
// 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) {
3529
if err != nil {
3630
t.Fatalf("LocalAddr: %v", err)
3731
}
38-
msgs, _, _ := sc.PrepareRawMessages(sc.batch)
32+
msgs, _, _, _ := sc.PrepareRawMessages(sc.batch, 0xffff, 16)
3933

4034
// Receive a real packet so the socket has carried data.
4135
send, err := net.Dial("udp", addr.String())
@@ -134,9 +128,9 @@ func runTeardownCase(t *testing.T, batch int, name string, traffic func(send net
134128
var received atomic.Int64
135129
loopDone := make(chan error, 1)
136130
go func() {
137-
loopDone <- sc.ListenOut(func(netip.AddrPort, []byte) {
131+
loopDone <- sc.ListenOut(func(netip.AddrPort, []byte, RxMeta) {
138132
received.Add(1)
139-
})
133+
}, func() {})
140134
}()
141135

142136
send, err := net.Dial("udp", addr.String())

0 commit comments

Comments
 (0)