tests: cloudproviders breaks GtkFileChooserDialog test
I have hesitated in enabling libcloudproviders
integration in Debian's gtk3 package because it causes the build tests to fail. (Debian runs the build tests during the package build and failing tests fail the build unless specifically ignored, and we'd rather not ignore tests that used to work.)
Build log excerpts below from gtk 3.22.28 on Debian.
Failure 1
/FinalizeObject/GtkFileChooserButton: OK
/FinalizeObject/GtkFileChooserDialog:
(/build/gtk+3.0-RNfbSU/gtk+3.0-3.22.28/debian/build/deb/testsuite/gtk/.libs/objects-finalize:18614): GLib-GObject-CRITICAL **: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
cleaning up pid 18629
FAIL
GTester: last random seed: R02S2c84dce107129cf04e0b635e41e2e250
(pid=18636)
/FinalizeObject/GtkFileChooserNative:
(/build/gtk+3.0-RNfbSU/gtk+3.0-3.22.28/debian/build/deb/testsuite/gtk/.libs/objects-finalize:18636): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'CloudProvidersCollector'
cleaning up pid 18651
FAIL
GTester: last random seed: R02Sd10b01bbc01b47ed600caa8115859f77
(pid=18658)
/FinalizeObject/GtkFileChooserWidget:
(/build/gtk+3.0-RNfbSU/gtk+3.0-3.22.28/debian/build/deb/testsuite/gtk/.libs/objects-finalize:18658): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'CloudProvidersCollector'
cleaning up pid 18673
FAIL
GTester: last random seed: R02Sc8b13d1399013906aa996ebbc6a02a6c
(pid=18680)
Failure 2
/Template/GtkColorChooserDialog/Basic: OK
/Template/GtkFileChooserWidget/Basic:
** (/build/gtk+3.0-RNfbSU/gtk+3.0-3.22.28/debian/build/deb/testsuite/gtk/.libs/templates:18817): WARNING **: Error acdquiring bus for cloud provider Could not connect: No such file or directory
FAIL
GTester: last random seed: R02S9a27f386ea4be780dd67e9cb2bceb81a
(pid=18839)
/Template/GtkFileChooserDialog/Basic:
** (/build/gtk+3.0-RNfbSU/gtk+3.0-3.22.28/debian/build/deb/testsuite/gtk/.libs/templates:18839): WARNING **: Error acdquiring bus for cloud provider Could not connect: No such file or directory
FAIL
GTester: last random seed: R02S1d1878b47767b0044da47fc4c257c4de
(pid=18859)
/Template/GtkFileChooserButton/Basic:
** (/build/gtk+3.0-RNfbSU/gtk+3.0-3.22.28/debian/build/deb/testsuite/gtk/.libs/templates:18859): WARNING **: Error acdquiring bus for cloud provider Could not connect: No such file or directory
FAIL
GTester: last random seed: R02S428d6644e55536e02edabaf46073d8c8
(pid=18877)
Comments
I mentioned this issue to @smcv on IRC who replied:
looks like that test blindly assumes a working D-Bus session bus, which buildds don't (and won't) have.
We can kludge around that in d/rules with dbus-run-session(1), but the real answer is for unit tests to not access the "real" session bus, ever - if they do, they risk trampling on a developer's real desktop session.
Answers for upstream include wrapping tests in dbus-run-session (like dbus-python does), or starting a session bus by hand (like GTestDBus, , or like flatpak's tests).
(tbh I wouldn't be very surprised if you found that a test for "cloud provider backends" assumes, not just a session bus, but also a session bus with services already present on it)
CC'ing @csoriano