MCPcopy
hub / github.com/perkeep/perkeep / numFDs

Function numFDs

pkg/index/sqlite/sqlite_test.go:128–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func 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
140func TestFDLeak(t *testing.T) {
141 if testing.Short() {

Callers 1

TestFDLeakFunction · 0.85

Calls 2

LookPathMethod · 0.65
CommandMethod · 0.65

Tested by

no test coverage detected