mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Enable leak checker for tcp_conntrack tests.
PiperOrigin-RevId: 424374964
This commit is contained in:
committed by
gVisor bot
parent
daea5b7674
commit
b57e94c303
@@ -18,6 +18,8 @@ go_test(
|
||||
srcs = ["tcp_conntrack_test.go"],
|
||||
deps = [
|
||||
":tcpconntrack",
|
||||
"//pkg/refs",
|
||||
"//pkg/refsvfs2",
|
||||
"//pkg/tcpip/header",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
package tcpconntrack_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"gvisor.dev/gvisor/pkg/refs"
|
||||
"gvisor.dev/gvisor/pkg/refsvfs2"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/header"
|
||||
"gvisor.dev/gvisor/pkg/tcpip/transport/tcpconntrack"
|
||||
)
|
||||
@@ -515,3 +518,10 @@ func TestIgnoreBadResetOnSynSent(t *testing.T) {
|
||||
func dataLen(tcp header.TCP) int {
|
||||
return len(tcp) - int(tcp.DataOffset())
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
refs.SetLeakMode(refs.LeaksPanic)
|
||||
code := m.Run()
|
||||
refsvfs2.DoLeakCheck()
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user