...
Source file
src/syscall/rlimit_test.go
Documentation: syscall
1
2
3
4
5
6
7 package syscall_test
8
9 import (
10 "os"
11 "runtime"
12 "testing"
13 )
14
15 func TestOpenFileLimit(t *testing.T) {
16
17
18
19
20
21
22 fileCount := 1200
23
24
25 if runtime.GOOS == "openbsd" {
26 fileCount = 768
27 }
28
29 var files []*os.File
30 for i := 0; i < fileCount; i++ {
31 f, err := os.Open("rlimit.go")
32 if err != nil {
33 t.Error(err)
34 break
35 }
36 files = append(files, f)
37 }
38
39 for _, f := range files {
40 f.Close()
41 }
42 }
43
View as plain text