From 8fd71dccc55d50323476b1eecc4415614aebda89 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 9 Dec 2019 15:12:56 +0100 Subject: [PATCH 1/2] tests: Enable GDBus debug for a number of unreliable tests As those tests keep failing in the CI, enable GDBus debugging to catch some debug leads when the problems happen. --- gio/tests/gdbus-connection-flush.c | 3 +++ gio/tests/gdbus-connection.c | 4 ++++ gio/tests/gdbus-server-auth.c | 3 +++ 3 files changed, 10 insertions(+) diff --git a/gio/tests/gdbus-connection-flush.c b/gio/tests/gdbus-connection-flush.c index 39f08e8aa..73a034b81 100644 --- a/gio/tests/gdbus-connection-flush.c +++ b/gio/tests/gdbus-connection-flush.c @@ -368,6 +368,9 @@ main (int argc, { gint ret; + /* FIXME: Add debug for https://gitlab.gnome.org/GNOME/glib/issues/1929 */ + g_setenv ("G_DBUS_DEBUG", "authentication", TRUE); + g_test_init (&argc, &argv, NULL); g_test_add ("/gdbus/connection/flush/busy", Fixture, NULL, diff --git a/gio/tests/gdbus-connection.c b/gio/tests/gdbus-connection.c index 6e4c7eb05..469018577 100644 --- a/gio/tests/gdbus-connection.c +++ b/gio/tests/gdbus-connection.c @@ -1256,6 +1256,10 @@ main (int argc, char *argv[]) { int ret; + + /* FIXME: Add debug for https://gitlab.gnome.org/GNOME/glib/issues/1957 */ + g_setenv ("G_DBUS_DEBUG", "all", TRUE); + g_test_init (&argc, &argv, NULL); /* all the tests rely on a shared main loop */ diff --git a/gio/tests/gdbus-server-auth.c b/gio/tests/gdbus-server-auth.c index d7312eab1..d8b361fc6 100644 --- a/gio/tests/gdbus-server-auth.c +++ b/gio/tests/gdbus-server-auth.c @@ -515,6 +515,9 @@ int main (int argc, char *argv[]) { + /* FIXME: Add debug for https://gitlab.gnome.org/GNOME/glib/issues/1954 */ + g_setenv ("G_DBUS_DEBUG", "all", TRUE); + g_test_init (&argc, &argv, NULL); g_test_add_func ("/gdbus/server-auth", test_server_auth); From 145dc5a49ee78e8d6a69360d598f055e7929b109 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 11 Dec 2019 11:38:24 +0100 Subject: [PATCH 2/2] gdbus: Fix runtime warning with debug enabled With debug enabled, g_dbus_connection_call_done() will throw a g_warning() if the call failed (on purpose or not) while trying to the serial of a non-existant reply. (/builds/GNOME/glib/_build/gio/tests/gdbus-connection:26921): GLib-GIO-CRITICAL **: 10:10:16.311: g_dbus_message_get_reply_serial: assertion 'G_IS_DBUS_MESSAGE (message)' failed --- gio/gdbusconnection.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c index 3411033f3..dbfc53953 100644 --- a/gio/gdbusconnection.c +++ b/gio/gdbusconnection.c @@ -5726,17 +5726,19 @@ g_dbus_connection_call_done (GObject *source, _g_dbus_debug_print_lock (); g_print ("========================================================================\n" "GDBus-debug:Call:\n" - " <<<< ASYNC COMPLETE %s() (serial %d)\n" - " ", - state->method_name, - g_dbus_message_get_reply_serial (reply)); + " <<<< ASYNC COMPLETE %s()", + state->method_name); + if (reply != NULL) { - g_print ("SUCCESS\n"); + g_print (" (serial %d)\n" + " SUCCESS\n", + g_dbus_message_get_reply_serial (reply)); } else { - g_print ("FAILED: %s\n", + g_print ("\n" + " FAILED: %s\n", error->message); } _g_dbus_debug_print_unlock ();