Mir

Merge lp:~afrantzis/mir/fix-1613523-nested-input-test into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 4085
Proposed branch: lp:~afrantzis/mir/fix-1613523-nested-input-test
Merge into: lp:mir
Diff against target: 33 lines (+6/-2)
1 file modified
tests/acceptance-tests/test_nested_input.cpp (+6/-2)
To merge this branch: bzr merge lp:~afrantzis/mir/fix-1613523-nested-input-test
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
Alan Griffiths Approve
Kevin DuBois (community) Approve
Mir CI Bot continuous-integration Approve
Review via email: mp+319821@code.launchpad.net

Commit message

tests: Wait for the input-device-state event before emitting key events to avoid receiving them out of order (LP: #1613523)

Description of the change

tests: Wait for the input-device-state event before emitting key events to avoid receiving them out of order (LP: #1613523)

Since I was in the area, I also increased the key event timeout to improve our chances of coping with a heavy load in CI.

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

PASSED: Continuous integration, rev:4085
https://mir-jenkins.ubuntu.com/job/mir-ci/3156/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4235
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4322
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4312
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4312
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4312
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4262
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4262/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4262
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4262/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4262
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4262/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/4262
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4262/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/4262
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4262/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4262
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4262/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK

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

ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/acceptance-tests/test_nested_input.cpp'
2--- tests/acceptance-tests/test_nested_input.cpp 2017-02-15 07:38:33 +0000
3+++ tests/acceptance-tests/test_nested_input.cpp 2017-03-14 14:03:55 +0000
4@@ -240,9 +240,11 @@
5 MockEventFilter nested_event_filter;
6 std::atomic<int> num_key_a_events{0};
7 auto const increase_key_a_events = [&num_key_a_events] { ++num_key_a_events; };
8+ mt::Signal devices_ready;
9
10 InSequence seq;
11- EXPECT_CALL(nested_event_filter, handle(mt::InputDeviceStateEvent()));
12+ EXPECT_CALL(nested_event_filter, handle(mt::InputDeviceStateEvent()))
13+ .WillOnce(DoAll(mt::WakeUp(&devices_ready), Return(true)));
14 EXPECT_CALL(nested_event_filter, handle(mt::KeyOfScanCode(KEY_A))).
15 Times(AtLeast(1)).
16 WillRepeatedly(DoAll(InvokeWithoutArgs(increase_key_a_events), Return(true)));
17@@ -255,6 +257,8 @@
18 NestedServerWithMockEventFilter nested_mir{new_connection(), mt::fake_shared(nested_event_filter)};
19 ExposedSurface client(nested_mir.new_connection());
20
21+ ASSERT_TRUE(devices_ready.wait_for(60s));
22+
23 // Because we are testing a nested setup, it's difficult to guarantee
24 // that the nested framebuffer window (and consenquently the client window
25 // contained in it) is going to be ready (i.e., exposed and focused) to receive
26@@ -268,7 +272,7 @@
27 fake_keyboard->emit_event(mis::a_key_up_event().of_scancode(KEY_A));
28 return false;
29 },
30- std::chrono::seconds{5});
31+ std::chrono::seconds{10});
32
33 EXPECT_TRUE(dummy_events_received);
34

Subscribers

People subscribed via source and target branches