summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-09-06 10:17:47 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-09-06 10:17:47 +0200
commit6ad67f13293669799659f9b953577dd6fb6e1597 (patch)
tree272603a7694d7fa0734b5409a1de4434c07de082
parentc3078a56d5f77260fe7cb2e6058415ced08c60d3 (diff)
integration-test: Fix occasional failure of test_luks_forced_removal
Sometimes the client's GDBusObjectManager does not refresh properly and keeps around objects which have long gone, which leads to a timeout in waiting for the device object to disappear. Presumably this is because the test suite does not run a main loop, and we cannot currently access g_main_context_get_default() from introspection. So instead, just generate a fresh client.
-rwxr-xr-xsrc/tests/integration-test4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tests/integration-test b/src/tests/integration-test
index e585121..5e30888 100755
--- a/src/tests/integration-test
+++ b/src/tests/integration-test
@@ -1140,6 +1140,10 @@ class Luks(UDisksTestCase):
if self.client.get_object(path) is None:
break
timeout -= 1
+ # we do not have a main loop, and cannot currently use
+ # g_main_context_get_default() from introspection, so
+ # instead of refreshing self.client, get a new one
+ self.client = UDisks.Client.new_sync(None)
time.sleep(0.1)
self.assertGreater(timeout, 0, 'timeout waiting for object path %s to disappear' % path)
finally: