Mir

Merge lp://qastaging/~afrantzis/mir/fix-surface-visibility-event-test into lp://qastaging/mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Andreas Pokorny
Approved revision: no longer in the source branch.
Merged at revision: 3550
Proposed branch: lp://qastaging/~afrantzis/mir/fix-surface-visibility-event-test
Merge into: lp://qastaging/mir
Diff against target: 130 lines (+25/-9)
3 files modified
src/include/server/mir/shell/canonical_window_manager.h (+3/-1)
src/server/shell/canonical_window_manager.cpp (+2/-0)
tests/acceptance-tests/test_client_surface_visibility.cpp (+20/-8)
To merge this branch: bzr merge lp://qastaging/~afrantzis/mir/fix-surface-visibility-event-test
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
Cemil Azizoglu (community) Approve
Mir CI Bot continuous-integration Approve
Review via email: mp+298135@code.qastaging.launchpad.net

Commit message

tests: Fix race conditions affecting MirSurfaceVisibilityEvent tests

Description of the change

tests: Fix race conditions affecting MirSurfaceVisibilityEvent tests

Three problems/races were identified and fixed:

1. WindowManagerPolicy function calls are normally serialized using locks in BasicWindowManager. However, msh::CanonicalWindowManagerPolicy::select_active_surface() could be called unlocked through SurfaceReadyObserver, leading to various races and subsequent failures. This was fixed by serializing select_active_surface() with an internal (recursive) lock. There are other solutions, which involve changing the API, but I didn't want to interfere with the API without Alan's feedback. This solution is good enough for now.

2. For reasons unknown, googlemock doesn't fully clear the expectations with VerifyAndClearExpectations(), causing intermittent failures for visibility events received during surface teardown. This problem was worked around by unsetting the client surface event handler before surface destruction.

3. Waiting for a surface to become visible is not a sufficient condition for testing that the surface has reached a steady state as needed by the tests. We also need to wait for the surface to get the focus. This MP fixes the problem by waiting for both visibility and focus state when creating a surface. We use a spin_wait instead of monitoring surface events to workaround the same googlemock problem mentioned in (2).

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3549
https://mir-jenkins.ubuntu.com/job/mir-ci/1173/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1320
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1371
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1362
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1362
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1334
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1334/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1334
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1334/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1334
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1334/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1334
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1334/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1334
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1334/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1173/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

LGTM

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches