After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703476 - tests/actor-offscreen-redirect: Fix race condition
tests/actor-offscreen-redirect: Fix race condition
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-02 16:27 UTC by Colin Walters
Modified: 2013-07-02 22:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests/actor-offscreen-redirect: Fix race condition (1.26 KB, patch)
2013-07-02 16:27 UTC, Colin Walters
none Details | Review
conform: Use a repaint function (9.30 KB, patch)
2013-07-02 21:06 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Colin Walters 2013-07-02 16:27:23 UTC
We've been observing this test failing very frequently
when the machine is under load; presumably the timeout is firing
before the stage has had a chance to do the initial draw.

Close this race by simply waiting for the initial paint
synchronously.
Comment 1 Colin Walters 2013-07-02 16:27:25 UTC
Created attachment 248246 [details] [review]
tests/actor-offscreen-redirect: Fix race condition
Comment 2 Emmanuele Bassi (:ebassi) 2013-07-02 21:06:36 UTC
Created attachment 248256 [details] [review]
conform: Use a repaint function

Timeouts and idles are subject to the whims of the load of the machine
running the tests, as we found out with the new installed tests and
OSTree-based VM running the conformance test suite continuously.

We should be able to use a repaint function and a blocking loop that
either is terminated because we hit g_assert(), or because a flag gets
toggled once we know that the Stage has been at least painted once.

The currently enabled tests using clutter_stage_read_pixels() have been
updated to this approach.
Comment 3 Colin Walters 2013-07-02 21:15:27 UTC
Review of attachment 248256 [details] [review]:

This patch looks reasonable at a high level to me, but I don't know the tests that well.  The actor-offscreen-redirect diff is somewhat obscured by the de-indentation, but if switching to  clutter_threads_add_repaint_func_full(_POST_PAINT) is enough to fix this, then it looks good to me.

Just one question:

::: tests/conform/texture-fbo.c
@@ -227,3 @@
-  /* We force continuous redrawing of the stage, since we need to skip
-   * the first few frames, and we wont be doing anything else that
-   * will trigger redrawing. */

Does this comment no longer apply?  We're doing a continuous redraw queue in the other actor-layout.c test.
Comment 4 Emmanuele Bassi (:ebassi) 2013-07-02 22:16:20 UTC
I think the actor-layout test should also stop queuing redraws: we can get away with just one, since we're blocking until it happens. with the timeout, the continuous redraw was added to work around races, and because I actually copied the code from previously existing tests without actually questioning the validity of the approach.
Comment 5 Emmanuele Bassi (:ebassi) 2013-07-02 22:24:10 UTC
actually, I just pushed a commit that removes the continuous queue_redraw() from actor-layout.c as well — and the installed tests seem to be working.

thanks!