[ARVADOS] updated: 4cb8583cba32497b14ccc775cafeb56b2e7d2fb1
Git user
git at public.curoverse.com
Wed Sep 14 11:04:39 EDT 2016
Summary of changes:
services/fuse/arvados_fuse/command.py | 1 +
services/fuse/tests/integration_test.py | 26 +++++++++++++++-----------
services/fuse/tests/mount_test_base.py | 11 +++++------
3 files changed, 21 insertions(+), 17 deletions(-)
via 4cb8583cba32497b14ccc775cafeb56b2e7d2fb1 (commit)
via 128127356f1c306bdf183fc2f34ea019369236b8 (commit)
from ed8f444ed60b46ec4b4d4f428896615661506201 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 4cb8583cba32497b14ccc775cafeb56b2e7d2fb1
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Sep 14 11:04:35 2016 -0400
9986: Move llfuse thread-shutdown check into a "finally" block so it actually runs.
diff --git a/services/fuse/arvados_fuse/command.py b/services/fuse/arvados_fuse/command.py
index c4b0df3..d15f017 100644
--- a/services/fuse/arvados_fuse/command.py
+++ b/services/fuse/arvados_fuse/command.py
@@ -117,6 +117,7 @@ class Mount(object):
self.llfuse_thread.daemon = True
self.llfuse_thread.start()
self.operations.initlock.wait()
+ return self
def __exit__(self, exc_type, exc_value, traceback):
subprocess.call(["fusermount", "-u", "-z", self.args.mountpoint])
diff --git a/services/fuse/tests/integration_test.py b/services/fuse/tests/integration_test.py
index c705934..b485037 100644
--- a/services/fuse/tests/integration_test.py
+++ b/services/fuse/tests/integration_test.py
@@ -4,6 +4,7 @@ import arvados_fuse.command
import atexit
import functools
import inspect
+import logging
import multiprocessing
import os
import run_test_server
@@ -72,16 +73,19 @@ class IntegrationTest(unittest.TestCase):
def decorator(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
- with arvados_fuse.command.Mount(
- arvados_fuse.command.ArgumentParser().parse_args(
- argv + ['--foreground',
- '--unmount-timeout=0.1',
- self.mnt])) as m:
- return func(self, *args, **kwargs)
- if m.llfuse_thread.is_alive():
- self.logger.warning("IntegrationTest.mount:"
- " llfuse thread still alive after umount"
- " -- killing test suite to avoid deadlock")
- os.kill(os.getpid(), signal.SIGKILL)
+ self.mount = None
+ try:
+ with arvados_fuse.command.Mount(
+ arvados_fuse.command.ArgumentParser().parse_args(
+ argv + ['--foreground',
+ '--unmount-timeout=2',
+ self.mnt])) as self.mount:
+ return func(self, *args, **kwargs)
+ finally:
+ if self.mount and self.mount.llfuse_thread.is_alive():
+ logging.warning("IntegrationTest.mount:"
+ " llfuse thread still alive after umount"
+ " -- killing test suite to avoid deadlock")
+ os.kill(os.getpid(), signal.SIGKILL)
return wrapper
return decorator
commit 128127356f1c306bdf183fc2f34ea019369236b8
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Sep 14 11:03:43 2016 -0400
9986: Report actual thread shutdown wait if >0.1s (instead of just saying it took >1s)
diff --git a/services/fuse/tests/mount_test_base.py b/services/fuse/tests/mount_test_base.py
index 5e0e4c7..20192f9 100644
--- a/services/fuse/tests/mount_test_base.py
+++ b/services/fuse/tests/mount_test_base.py
@@ -67,17 +67,16 @@ class MountTestBase(unittest.TestCase):
def tearDown(self):
if self.llfuse_thread:
subprocess.call(["fusermount", "-u", "-z", self.mounttmp])
- self.llfuse_thread.join(timeout=1)
- if self.llfuse_thread.is_alive():
- logger.warning("MountTestBase.tearDown():"
- " llfuse thread still alive 1s after umount"
- " -- waiting another 10s")
- self.llfuse_thread.join(timeout=10)
+ t0 = time.time()
+ self.llfuse_thread.join(timeout=10)
if self.llfuse_thread.is_alive():
logger.warning("MountTestBase.tearDown():"
" llfuse thread still alive 10s after umount"
" -- exiting with SIGKILL")
os.kill(os.getpid(), signal.SIGKILL)
+ waited = time.time() - t0
+ if waited > 0.1:
+ logger.warning("MountTestBase.tearDown(): waited %f s for llfuse thread to end", waited)
os.rmdir(self.mounttmp)
if self.keeptmp:
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list