Mir

Merge lp:~kdub/mir/fix-1602646 into lp:mir

Proposed by Kevin DuBois
Status: Merged
Merged at revision: 3586
Proposed branch: lp:~kdub/mir/fix-1602646
Merge into: lp:mir
Diff against target: 31 lines (+7/-3)
1 file modified
tests/acceptance-tests/test_nested_input.cpp (+7/-3)
To merge this branch: bzr merge lp:~kdub/mir/fix-1602646
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Andreas Pokorny (community) Approve
Mir CI Bot continuous-integration Needs Fixing
Review via email: mp+299945@code.launchpad.net

Commit message

fix LP: #1602646 by synchronizing expectations on both clients. under load, sometimes the host to client instance could receive events after

fixes: LP: #1602646

Description of the change

fix LP: #1602646 by synchronizing expectations on both clients. under load, sometimes the host to client instance could receive events after

fixes: LP: #1602646

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

FAILED: Continuous integration, rev:3586
https://mir-jenkins.ubuntu.com/job/mir-ci/1276/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1494/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1547
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1538
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1538
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1538
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1509/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/1509/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1509/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1509/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/1509
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1509/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/1509/console

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Ok I could reproduce cases where the clients would still receive events while the test is shutting down. But it does not occur anymore with this MP.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) :
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 2016-07-06 21:47:33 +0000
3+++ tests/acceptance-tests/test_nested_input.cpp 2016-07-13 13:20:13 +0000
4@@ -279,6 +279,8 @@
5
6 TEST_F(NestedInput, on_input_device_state_nested_server_emits_input_device_state)
7 {
8+ mir::test::Signal client_to_host_event_received;
9+ mir::test::Signal client_to_nested_event_received;
10 MockEventFilter nested_event_filter;
11 NestedServerWithMockEventFilter nested_mir{new_connection(), mt::fake_shared(nested_event_filter)};
12 ExposedSurface client_to_nested_mir(nested_mir.new_connection());
13@@ -287,13 +289,15 @@
14 ExposedSurface client_to_host(new_connection());
15 client_to_host.ready_to_accept_events.wait_for(1s);
16
17- EXPECT_CALL(client_to_host, handle_input(mt::KeyOfScanCode(KEY_LEFTALT)));
18+ EXPECT_CALL(client_to_host, handle_input(mt::KeyOfScanCode(KEY_LEFTALT)))
19+ .WillOnce(mt::WakeUp(&client_to_host_event_received));
20 EXPECT_CALL(nested_event_filter,
21 handle(mt::DeviceStateWithPressedKeys(std::vector<uint32_t>({KEY_LEFTALT, KEY_TAB}))))
22- .WillOnce(DoAll(mt::WakeUp(&all_events_received), Return(true)));
23+ .WillOnce(DoAll(mt::WakeUp(&client_to_nested_event_received), Return(true)));
24
25 fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_LEFTALT));
26 fake_keyboard->emit_event(mis::a_key_down_event().of_scancode(KEY_TAB));
27
28- all_events_received.wait_for(2s);
29+ client_to_nested_event_received.wait_for(2s);
30+ client_to_host_event_received.wait_for(2s);
31 }

Subscribers

People subscribed via source and target branches