Skip to content

Commit 23ecad0

Browse files
committed
os/exec: tell lsof not to block
For some reason lsof is now hanging on my workstation without the -b (avoid blocking in the kernel) option. Adding -b makes the test pass and shouldn't hurt. I don't know how recent the -b option is. If the builders are ok with it, it's probably ok. LGTM=rsc R=golang-codereviews, bradfitz, rsc CC=golang-codereviews https://golang.org/cl/166220043
1 parent 908dcab commit 23ecad0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/os/exec/exec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func TestPipeLookPathLeak(t *testing.T) {
246246
}
247247

248248
func numOpenFDS(t *testing.T) (n int, lsof []byte) {
249-
lsof, err := exec.Command("lsof", "-n", "-p", strconv.Itoa(os.Getpid())).Output()
249+
lsof, err := exec.Command("lsof", "-b", "-n", "-p", strconv.Itoa(os.Getpid())).Output()
250250
if err != nil {
251251
t.Skip("skipping test; error finding or running lsof")
252252
}

0 commit comments

Comments
 (0)