From 6ad67f13293669799659f9b953577dd6fb6e1597 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 6 Sep 2012 10:17:47 +0200 Subject: [PATCH] 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. --- src/tests/integration-test | 4 ++++ 1 file changed, 4 insertions(+) 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: -- 2.7.4