[gvfs] gvfs-test: Fix gvfs-mount waiting



commit fbc059e0f43dfab3db0916992019eb955adfe1c8
Author: Martin Pitt <martinpitt gnome org>
Date:   Tue Oct 16 15:59:05 2012 +0200

    gvfs-test: Fix gvfs-mount waiting
    
    unmount() was missing an actual sleep() in the waiting loop, leading to way too
    intensive polling.
    
    Also, always wait() on the Popen'ed gvfs-mount, to ensure we don't get zombies.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686006

 test/gvfs-test |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index bcffd4f..6e018be 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -119,12 +119,13 @@ class GvfsTestCase(unittest.TestCase):
     def unmount(self, uri):
         self.program_out_success(['gvfs-mount', '-u', uri])
 
-        timeout = 50
+        timeout = 5
         while timeout > 0:
             (out, err) = self.program_out_err(['gvfs-mount', '-li'])
             if 'Mount(0)' not in out:
                 break
             timeout -= 1
+            time.sleep(1)
         else:
             self.fail('gvfs-mount -u %s failed' % uri)
 
@@ -548,8 +549,8 @@ ncalrpc dir = %(workdir)s/samba
                 break
         else:
             mount.terminate()
-            mount.wait()
             self.fail('timed out waiting for gvfs-mount %s' % uri)
+        mount.wait()
 
         self.do_mount_check(uri, False)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]