• Michael Munday's avatar
    os/exec: deflake TestPipeLookPathLeak · 221bc23a
    Michael Munday authored
    The number of open file descriptors reported by lsof is unreliable
    because it depends on whether the parent process (the test) closed
    the file descriptors it passed into the child process (lsof) before
    lsof runs.
    
    Reading /proc/self/fd directly on Linux appears to be much more
    reliable and still detects any file descriptor leaks originating
    from attempting to run an executable that cannot be found (issue
    #5071). If /proc/self/fd is not available (e.g. on Darwin) then we
    fall back to lsof and tolerate small differences in open file
    descriptor counts.
    
    Fixes #19243.
    
    Change-Id: I052b0c129e609010f1083e43a9911cba154117bf
    Reviewed-on: https://go-review.googlesource.com/37343
    Run-TryBot: Michael Munday <munday@ca.ibm.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    221bc23a
Name
Last commit
Last update
..
example_test.go Loading commit data...
exec.go Loading commit data...
exec_posix.go Loading commit data...
exec_posix_test.go Loading commit data...
exec_test.go Loading commit data...
internal_test.go Loading commit data...
lp_plan9.go Loading commit data...
lp_test.go Loading commit data...
lp_unix.go Loading commit data...
lp_unix_test.go Loading commit data...
lp_windows.go Loading commit data...
lp_windows_test.go Loading commit data...