9986: Kill test suite when danger of deadlock is detected.
[arvados.git] / services / fuse / tests / integration_test.py
index d0e3102b6766ca8d5ad3b8975762feb746b828a1..c70593488e204ac252e596bdef7ab0168425dbd4 100644 (file)
@@ -76,7 +76,12 @@ class IntegrationTest(unittest.TestCase):
                         arvados_fuse.command.ArgumentParser().parse_args(
                             argv + ['--foreground',
                                     '--unmount-timeout=0.1',
-                                    self.mnt])):
+                                    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)
             return wrapper
         return decorator