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
=== modified file 'tests/acceptance-tests/test_client_input.cpp'
--- tests/acceptance-tests/test_client_input.cpp 2015-05-27 17:39:11 +0000
+++ tests/acceptance-tests/test_client_input.cpp 2015-06-15 14:43:21 +0000
@@ -66,6 +66,10 @@
66const int surface_width = 100;66const int surface_width = 100;
67const int surface_height = 100;67const int surface_height = 100;
6868
69void null_event_handler(MirSurface*, MirEvent const*, void*)
70{
71}
72
69struct Client73struct Client
70{74{
71 MirSurface* surface{nullptr};75 MirSurface* surface{nullptr};
@@ -120,6 +124,10 @@
120 }124 }
121 ~Client()125 ~Client()
122 {126 {
127 // Remove the event handler to avoid handling spurious events unrelated
128 // to the tests (e.g. pointer leave events when the surface is destroyed),
129 // which can cause test expectations to fail.
130 mir_surface_set_event_handler(surface, null_event_handler, nullptr);
123 mir_surface_release_sync(surface);131 mir_surface_release_sync(surface);
124 mir_connection_release(connection);132 mir_connection_release(connection);
125 }133 }

Subscribers

People subscribed via source and target branches