[glib: 3/12] tests: Isolate directory access for gdbus-connection-flush test
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/12] tests: Isolate directory access for gdbus-connection-flush test
- Date: Mon, 14 Mar 2022 12:52:45 +0000 (UTC)
commit 8cff531520f15c960b9b4c8471039ad515ebd2ef
Author: Philip Withnall <pwithnall endlessos org>
Date: Sat Mar 12 00:03:05 2022 +0000
tests: Isolate directory access for gdbus-connection-flush test
When multiple tests were run in parallel, this would race on its access
to `~/.dbus-keyrings` to authenticate with the D-Bus server, since the
keyring directory was not appropriately sandboxed to the unit test.
Use `G_TEST_OPTION_ISOLATE_DIRS` to automatically isolate each unit
test’s directory usage.
This should hopefully fix the failure seen in
https://gitlab.gnome.org/GNOME/glib/-/jobs/1849524, where the following
was in the log for a test executed in parallel:
```
GDBus-DBUS_COOKIE_SHA1: Deleted stale lock file '/home/user/.dbus-keyrings/org_gtk_gdbus_general.lock'
```
Signed-off-by: Philip Withnall <pwithnall endlessos org>
gio/tests/gdbus-connection-flush.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/tests/gdbus-connection-flush.c b/gio/tests/gdbus-connection-flush.c
index a48e263b5..c1647651e 100644
--- a/gio/tests/gdbus-connection-flush.c
+++ b/gio/tests/gdbus-connection-flush.c
@@ -368,7 +368,7 @@ main (int argc,
{
gint ret;
- g_test_init (&argc, &argv, NULL);
+ g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
g_test_add ("/gdbus/connection/flush/busy", Fixture, NULL,
setup, test_flush_busy, teardown);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]