testlib: use lsof +E for much clearer leaked FD output

pull/612/head
David Wilson 5 years ago
parent 70deb34bce
commit c0d87c0aa1

@ -338,7 +338,7 @@ class TestCase(unittest2.TestCase):
def _teardown_check_fds(self): def _teardown_check_fds(self):
mitogen.core.Latch._on_fork() mitogen.core.Latch._on_fork()
if get_fd_count() != self._fd_count_before: if get_fd_count() != self._fd_count_before:
import os; os.system('lsof -w -p %s' % (os.getpid(),)) import os; os.system('lsof +E -w -p %s' % (os.getpid(),))
assert 0, "%s leaked FDs. Count before: %s, after: %s" % ( assert 0, "%s leaked FDs. Count before: %s, after: %s" % (
self, self._fd_count_before, get_fd_count(), self, self._fd_count_before, get_fd_count(),
) )

Loading…
Cancel
Save