9986: Report actual thread shutdown wait if >0.1s (instead of just saying it took...
authorTom Clegg <tom@curoverse.com>
Wed, 14 Sep 2016 15:03:43 +0000 (11:03 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 14 Sep 2016 16:03:01 +0000 (12:03 -0400)
services/fuse/tests/mount_test_base.py

index 5e0e4c700ab08468b6b53a29b27d3ecd369ee91a..20192f9d84302e1d9967136bcfa19e03ef7012dd 100644 (file)
@@ -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: