Mir

Merge lp:~albaguirre/mir/fix-test-client-input-failures into lp:mir

Proposed by Alberto Aguirre
Status: Merged
Approved by: Alberto Aguirre
Approved revision: 3185
Merged at revision: 3186
Proposed branch: lp:~albaguirre/mir/fix-test-client-input-failures
Merge into: lp:mir
Diff against target: 48 lines (+20/-3)
1 file modified
tests/acceptance-tests/test_client_input.cpp (+20/-3)
To merge this branch: bzr merge lp:~albaguirre/mir/fix-test-client-input-failures
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Daniel van Vugt Approve
Andreas Pokorny (community) Approve
Review via email: mp+280063@code.launchpad.net

Commit message

tests: TestClientInput: fix race between sending a fake event and surface becoming ready to receive events

Description of the change

tests: TestClientInput: fix race between sending a fake event and surface becoming ready to receive events

To post a comment you must log in.
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

lgtm

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

"6: [ RUN ] ClientLatency.throttled_input_rate_yields_lower_latency
6: [1449705449.168071] mirserver: Starting
6: [1449705449.168149] mirserver: Selected driver: dummy (version 0.19.0)
6: [1449705449.170028] mirserver: Initial display configuration:
6: [1449705449.170953] mirserver: Using software cursor
6: [1449705449.171309] mirserver: Selected input driver: stub-input (version: 0.19.0)
6: [1449705449.171343] mirserver: Mir version 0.19.0
6: /mir/tests/acceptance-tests/test_latency.cpp:259: Failure
6: Value of: observed_latency
6: Expected: is < 1.1
6: Actual: 1.15 (of type float)
6: [1449705451.380062] mirserver: Stopping
6: [ FAILED ] ClientLatency.throttled_input_rate_yields_lower_latency (2230 ms)
"

Failure is lp:1509291

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's sounding good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

"6: /mir/tests/acceptance-tests/test_nested_mir.cpp:549: Failure
6: Actual function call count doesn't match EXPECT_CALL(*mock_cursor, show(_))...
6: Expected: to be called once
6: Actual: never called - unsatisfied and active
6: [1449708539.438760] mirserver: Stopping
6: [1449708539.463858] mirserver: Stopping
6: [ FAILED ] NestedServer.animated_cursor_image_changes_are_forwarded_to_host (1116 ms)"

That's lp:1523621, unrelated to this branch.

I'm winning the CI fail lottery today... Let's try again.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/acceptance-tests/test_client_input.cpp'
2--- tests/acceptance-tests/test_client_input.cpp 2015-11-05 11:51:04 +0000
3+++ tests/acceptance-tests/test_client_input.cpp 2015-12-09 17:59:04 +0000
4@@ -105,6 +105,23 @@
5 BOOST_THROW_EXCEPTION(std::runtime_error("Timeout waiting for surface to become focused and exposed"));
6 }
7
8+ void handle_surface_event(MirSurfaceEvent const* event)
9+ {
10+ auto const attrib = mir_surface_event_get_attribute(event);
11+ auto const value = mir_surface_event_get_attribute_value(event);
12+
13+ if (mir_surface_attrib_visibility == attrib &&
14+ mir_surface_visibility_exposed == value)
15+ exposed = true;
16+
17+ if (mir_surface_attrib_focus == attrib &&
18+ mir_surface_focused == value)
19+ focused = true;
20+
21+ if (exposed && focused)
22+ ready_to_accept_events.wake_up_everyone();
23+ }
24+
25 static void handle_event(MirSurface*, MirEvent const* ev, void* context)
26 {
27 auto const client = static_cast<Client*>(context);
28@@ -112,10 +129,8 @@
29 if (type == mir_event_type_surface)
30 {
31 auto surface_event = mir_event_get_surface_event(ev);
32+ client->handle_surface_event(surface_event);
33
34- if (mir_surface_attrib_focus == mir_surface_event_get_attribute(surface_event) &&
35- 1 == mir_surface_event_get_attribute_value(surface_event))
36- client->ready_to_accept_events.wake_up_everyone();
37 }
38 if (type == mir_event_type_input)
39 client->handle_input(ev);
40@@ -134,6 +149,8 @@
41 MirConnection * connection;
42 mir::test::WaitCondition ready_to_accept_events;
43 mir::test::WaitCondition all_events_received;
44+ bool exposed = false;
45+ bool focused = false;
46 };
47
48 struct TestClientInput : mtf::HeadlessInProcessServer

Subscribers

People subscribed via source and target branches