g_test_dbus_down: Ensure next test does not use old connection3d50691a30270de8c880a5ad6b0be2f8ec36a673
commit3d50691a30270de8c880a5ad6b0be2f8ec36a673
authorSimon McVittie <smcv@debian.org>
Wed, 4 Apr 2018 07:35:39 +0000 (4 08:35 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Tue, 10 Apr 2018 10:22:41 +0000 (10 11:22 +0100)
tree0c7ee8d0d4363c8c97c45eeb66e5dbc6af4df51e
parentb806df0ef136b17251b01d962830f49301bbed0e
g_test_dbus_down: Ensure next test does not use old connection

There's a race condition somewhere in GTestDBus that can result in
the next test being started at a time when g_bus_get() would still
return the connection that is in the process of closing. This can
be reproduced reasonably reliably by running the gapplication test
10K times in a loop.

Instead of relying on waiting for the weak reference to be released,
we can force the issue by clearing it.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=768996
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894677
gio/gdbusconnection.c
gio/gdbusprivate.h
gio/gtestdbus.c