Mir

Merge lp:~afrantzis/mir/fix-1465231-test-client-input-race into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Alberto Aguirre
Approved revision: no longer in the source branch.
Merged at revision: 2661
Proposed branch: lp:~afrantzis/mir/fix-1465231-test-client-input-race
Merge into: lp:mir
Diff against target: 25 lines (+8/-0)
1 file modified
tests/acceptance-tests/test_client_input.cpp (+8/-0)
To merge this branch: bzr merge lp:~afrantzis/mir/fix-1465231-test-client-input-race
Reviewer Review Type Date Requested Status
Alberto Aguirre (community) Approve
Kevin DuBois (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+261972@code.launchpad.net

Commit message

tests: Don't handle spurious events that can cause TestClientInput tests to fail

Description of the change

tests: Don't handle spurious events that can cause TestClientInput tests to fail

This MP removes the event handler before destroying surfaces, to avoid handling spurious events unrelated to the tests (e.g. pointer leave events when the surface is destroyed), which can cause test expectations to fail.

The problem affects all TestClientInput tests and could explain other spurious CI failures we have seen in the past in these tests.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm

review: Approve
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

LGTM

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_client_input.cpp'
2--- tests/acceptance-tests/test_client_input.cpp 2015-05-27 17:39:11 +0000
3+++ tests/acceptance-tests/test_client_input.cpp 2015-06-15 14:43:21 +0000
4@@ -66,6 +66,10 @@
5 const int surface_width = 100;
6 const int surface_height = 100;
7
8+void null_event_handler(MirSurface*, MirEvent const*, void*)
9+{
10+}
11+
12 struct Client
13 {
14 MirSurface* surface{nullptr};
15@@ -120,6 +124,10 @@
16 }
17 ~Client()
18 {
19+ // Remove the event handler to avoid handling spurious events unrelated
20+ // to the tests (e.g. pointer leave events when the surface is destroyed),
21+ // which can cause test expectations to fail.
22+ mir_surface_set_event_handler(surface, null_event_handler, nullptr);
23 mir_surface_release_sync(surface);
24 mir_connection_release(connection);
25 }

Subscribers

People subscribed via source and target branches