[glib: 4/5] tests: Isolate directories in gdbus-peer test



commit 6fb38c3f25e8e859812e25fe88fad752a68133b3
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Oct 28 19:42:41 2019 +0000

    tests: Isolate directories in gdbus-peer test
    
    So that the tests all end up using separate `.dbus-keyring` directories,
    and hence not racing to create and acquire lock files, use
    `G_TEST_OPTION_ISOLATE_DIRS` to ensure they all run in separate
    disposable directories.
    
    This has the added benefit of meaning they don’t touch the developer’s
    actual `$HOME` directory.
    
    This reduces the false-failure rate of `gdbus-peer` by a factor of 9 for
    me on my local machine.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Fixes: #1912

 gio/tests/gdbus-peer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c
index b410e80d1..dc4176cf2 100644
--- a/gio/tests/gdbus-peer.c
+++ b/gio/tests/gdbus-peer.c
@@ -1922,7 +1922,7 @@ main (int   argc,
   gint ret;
   GDBusNodeInfo *introspection_data = NULL;
 
-  g_test_init (&argc, &argv, NULL);
+  g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL);
 
   introspection_data = g_dbus_node_info_new_for_xml (test_interface_introspection_xml, NULL);
   g_assert (introspection_data != NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]