GNOME Bugzilla – Bug 698548
Speed up make check
Last modified: 2017-03-27 14:41:08 UTC
There are a number of unittests which use sleeps or timeouts for testing various things (loops, io, subprocesses). While some of this is obviously necessary it would be good to review where they are used and see if anything can be tightened up. The big one for me at the moment is "test_overrides_gtk.TestGtk.test_dialogs" because it causes my NAS to spin up.
Created attachment 348404 [details] [review] tests: Remove TestMainLoop.test_concurrency The code containing the bug no longer exists and the test doesn't do what it says. The thread never gets terminated and it doesn't assert anything. And I'm not sure what it should assert. For the corresponding bug see https://bugzilla.gnome.org/show_bug.cgi?id=663068 While the test doesn't hurt, it adds half a second wait time to the test suite.
Created attachment 348405 [details] [review] tests: Reduce usage of timeout_add() and sleep() * Instead of waiting for a fixed time, use a timeout and stop the main loop right after the test has succeeded. * Replace time.sleep to sync processes with os.pipe communication * Chain idle sources instead of using multiple timeout sources * Replace sleeps with unbufferd communication
With both patches the test time is reduced by ~4sec (it's about 5-6sec in total now)
My guess for the dialogs test being slow would be the filechooser fetching some info regarding the mount points. They are not slow here.