From 59ce6b10dc93746dcae081d01dbe13a254430b4b Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Mon, 1 Jul 2019 17:12:50 -0700 Subject: [PATCH] gdbus-connection-loss: Fix test failure Now that we're not calling g_object_run_dispose() indirectly in g_test_dbus_down() (see commit "Revert "gtestdbus: Properly close server connections""), the test gdbus-connection-loss is failing with the message "Bail out! GLib-GIO-FATAL-WARNING: Weak notify timeout, object ref_count=1". This is because we're holding a reference to the singleton connection object while calling session_bus_down() in the test's main(). So then we end up waiting for 30 seconds in _g_object_unref_and_wait_weak_notify() for the GWeakNotify to be triggered, which never happens. The fix is to unref the connection before calling session_bus_down(). This is consistent with how other tests work, and is safe because the only method called on the connection has already errored out, as asserted by the test. --- gio/tests/gdbus-connection-loss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gio/tests/gdbus-connection-loss.c b/gio/tests/gdbus-connection-loss.c index 9dbbeb2a4..8f7023f3f 100644 --- a/gio/tests/gdbus-connection-loss.c +++ b/gio/tests/gdbus-connection-loss.c @@ -136,9 +136,10 @@ main (int argc, ret = g_test_run(); + g_object_unref (c); + session_bus_down (); - g_object_unref (c); g_main_loop_unref (loop); return ret;