(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func numFDs(t *testing.T) int { |
| 129 | lsofPath, err := exec.LookPath("lsof") |
| 130 | if err != nil { |
| 131 | t.Skipf("No lsof available; skipping test") |
| 132 | } |
| 133 | out, err := exec.Command(lsofPath, "-n", "-p", fmt.Sprint(os.Getpid())).Output() |
| 134 | if err != nil { |
| 135 | t.Skipf("Error running lsof; skipping test: %s", err) |
| 136 | } |
| 137 | return bytes.Count(out, []byte("\n")) - 1 // hacky |
| 138 | } |
| 139 | |
| 140 | func TestFDLeak(t *testing.T) { |
| 141 | if testing.Short() { |
no test coverage detected