ceremonyclient/go-libp2p-kad-dht/nofile_test.go
2024-10-12 11:48:25 -07:00

24 lines
350 B
Go

//go:build !windows && !wasm
package dht
import (
"fmt"
"os"
"testing"
"syscall"
)
func TestMain(m *testing.M) {
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &syscall.Rlimit{
Cur: 4096,
Max: 4096,
})
if err != nil {
fmt.Println("failed to increase open file descriptor limit, can't run tests")
os.Exit(1)
}
os.Exit(m.Run())
}