From ef7cf7ac92be5c8dbaf465504f96467c470f3ccc Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 20 Sep 2016 05:56:19 +0200 Subject: [PATCH] Fix tests: Don't try to use policykit during the tests Creating a policykit proxy was causing timeouts for me for unclear reasons when running under the tests. But we're not using policykit at all during the tests, so we can just avoid this call completely. --- system-helper/flatpak-system-helper.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/system-helper/flatpak-system-helper.c b/system-helper/flatpak-system-helper.c index c26222800..5758c21bb 100644 --- a/system-helper/flatpak-system-helper.c +++ b/system-helper/flatpak-system-helper.c @@ -783,11 +783,14 @@ main (int argc, if (verbose) g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL); - authority = polkit_authority_get_sync (NULL, &error); - if (authority == NULL) + if (!on_session_bus) { - g_printerr ("Can't get polkit authority: %s\n", error->message); - return 1; + authority = polkit_authority_get_sync (NULL, &error); + if (authority == NULL) + { + g_printerr ("Can't get polkit authority: %s\n", error->message); + return 1; + } } exe_path_len = readlink ("/proc/self/exe", exe_path, sizeof (exe_path) - 1);