summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-02-01 15:11:07 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-02-01 15:12:44 +0100
commit5b96cf7d00194fa99dedf504c7e36e2e2ee80a28 (patch)
tree4db71f75cc5fdf7e05d5c55c8d11bec140f3fd4a /test
parentc71f53ace39950fff3a424ba52c97dc557296cfa (diff)
downloadgvfs-5b96cf7d00194fa99dedf504c7e36e2e2ee80a28.tar.gz
tests: Fix race condition in Drive tests
In load_image(), process all pending main loop events to get an up to date volume monitor. Not doing that can cause tests to still see the temporarily added and removed device that was created for loading the image.
Diffstat (limited to 'test')
-rwxr-xr-xtest/gvfs-test3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index 97172151..5950088c 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -930,6 +930,9 @@ class Drive(GvfsTestCase):
time.sleep(0.2)
# flush volume monitor output
+ ctx = GLib.MainContext().default()
+ while ctx.iteration(False):
+ pass
self.monitor.stdout.readall()
def setUp(self):