[glib: 1/2] tests: Don’t exit gdbus-method-invocation test early on connection close
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] tests: Don’t exit gdbus-method-invocation test early on connection close
- Date: Tue, 5 Apr 2022 14:23:53 +0000 (UTC)
commit 82ad0510d223cf64e636a77ace972414abf6387b
Author: Philip Withnall <pwithnall endlessos org>
Date: Tue Apr 5 14:43:16 2022 +0100
tests: Don’t exit gdbus-method-invocation test early on connection close
There’s (deliberately) a bit of race in implementing/handling
`CloseBeforeReturning()` in `gdbus-method-invocation.c`. If the server
closes the D-Bus connection early, the client may exit with `SIGTERM` if
`GDBusConnection:exit-on-close` is set. We don’t want that, as the test
is trying to check that the default handling of a D-Bus method return
after a connection has closed works.
See https://gnome.pages.gitlab.gnome.org/-/glib/-/jobs/1935191/artifacts/_build/meson-logs/testlog.txt
Signed-off-by: Philip Withnall <pwithnall endlessos org>
gio/tests/gdbus-method-invocation.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gio/tests/gdbus-method-invocation.c b/gio/tests/gdbus-method-invocation.c
index 985fd45ced..45fb67757e 100644
--- a/gio/tests/gdbus-method-invocation.c
+++ b/gio/tests/gdbus-method-invocation.c
@@ -300,6 +300,10 @@ test_method_invocation_return (void)
g_assert_no_error (local_error);
g_assert_nonnull (connection);
+ /* Don’t exit the test when the server closes the connection in
+ * CloseBeforeReturning(). */
+ g_dbus_connection_set_exit_on_close (connection, FALSE);
+
/* Register an object which we can call methods on. */
registration_id = g_dbus_connection_register_object (connection,
"/foo",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]