mirror of https://gitee.com/openkylin/gvfs.git
gvfs-test: Increase timeout to 10s
In normal operation some operations - particularly unmounting - can take quite a while. Let's give things a bit longer before giving up. Patch originally by Andreas Hasenack <andreas.hasenack@canonical.com> Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=794487 Gbp-Pq: Name 0009-gvfs-test-Increase-timeout-to-10s.patch
This commit is contained in:
parent
730b11d8ce
commit
d3f0667cd1
|
@ -176,7 +176,7 @@ class GvfsTestCase(unittest.TestCase):
|
||||||
def unmount(self, uri):
|
def unmount(self, uri):
|
||||||
self.program_out_success(['gio', 'mount', '-u', uri])
|
self.program_out_success(['gio', 'mount', '-u', uri])
|
||||||
|
|
||||||
timeout = 5
|
timeout = 10
|
||||||
while timeout > 0:
|
while timeout > 0:
|
||||||
(out, err) = self.program_out_err(['gio', 'mount', '-li'])
|
(out, err) = self.program_out_err(['gio', 'mount', '-li'])
|
||||||
if not re.search('Mount.*' + uri, out):
|
if not re.search('Mount.*' + uri, out):
|
||||||
|
@ -265,7 +265,7 @@ class GvfsTestCase(unittest.TestCase):
|
||||||
def unmount_api(self, gfile):
|
def unmount_api(self, gfile):
|
||||||
'''Umount a mounted Gio.File using the Gio API
|
'''Umount a mounted Gio.File using the Gio API
|
||||||
|
|
||||||
This times out after 5 seconds.
|
This times out after 10 seconds.
|
||||||
'''
|
'''
|
||||||
self.cb_result = None
|
self.cb_result = None
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ class GvfsTestCase(unittest.TestCase):
|
||||||
mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, None, None,
|
mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, None, None,
|
||||||
unmount_done, ml)
|
unmount_done, ml)
|
||||||
# ensure we are timing out
|
# ensure we are timing out
|
||||||
GLib.timeout_add_seconds(5, lambda data: ml.quit(), None)
|
GLib.timeout_add_seconds(10, lambda data: ml.quit(), None)
|
||||||
ml.run()
|
ml.run()
|
||||||
|
|
||||||
self.assertNotEqual(self.cb_result, None, 'operation timed out')
|
self.assertNotEqual(self.cb_result, None, 'operation timed out')
|
||||||
|
|
Loading…
Reference in New Issue