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>
This commit is contained in:
Philip Withnall 2022-04-05 14:43:16 +01:00
parent e5316bb5ab
commit 82ad0510d2

View File

@ -300,6 +300,10 @@ test_method_invocation_return (void)
g_assert_no_error (local_error);
g_assert_nonnull (connection);
/* Dont 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",