GNOME Bugzilla – Bug 768996
gapplication/quit test fails intermittently
Last modified: 2018-04-10 10:29:26 UTC
glib 2.49.3 Running the gio/tests/gapplication test in a loop, it eventually fails with: /gapplication/no-dbus: OK /gapplication/no-appid: OK /gapplication/properties: OK /gapplication/app-id: OK /gapplication/quit: Failed to register: The connection is closed ** GLib-GIO:ERROR:/build/glib2.0-2.49.3/./gio/tests/gapplication.c:564:test_quit: assertion failed: (activated) cleaning up pid 24437 Aborted (core dumped) (gdb) bt
+ Trace 236473
Don't do that, then ?
Normally I wouldn't do that :p But I made a normal build and the test suite failed there. And when trying to reproduce it, I found it's not 100% reproducible. Probably a race.
See also Bug #721921, which might have the same root cause.
Created attachment 370520 [details] [review] 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.
Review of attachment 370520 [details] [review]: Looks good, thanks. Since this affects more than just the tests (since it modifies GTestDBus), I’m only going to push it to master unless you particularly also want it backported to glib-2-56. Let me know if so. I think this patch is orthogonal (does not conflict with) Allison’s suggested solution for https://bugzilla.gnome.org/show_bug.cgi?id=721921#c13, since GTestDBus comes under cases #3 (and #4, to a certain extent) of that list. We’re not impacting on cases #1 and #2.
Pushed to master. Attachment 370520 [details] pushed as 3d50691 - g_test_dbus_down: Ensure next test does not use old connection