Mir

Merge lp:~afrantzis/mir/fix-shutdown-with-blocked-clients-test into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Alexandros Frantzis
Approved revision: no longer in the source branch.
Merged at revision: 1740
Proposed branch: lp:~afrantzis/mir/fix-shutdown-with-blocked-clients-test
Merge into: lp:mir
Diff against target: 39 lines (+8/-7)
1 file modified
tests/acceptance-tests/test_server_shutdown.cpp (+8/-7)
To merge this branch: bzr merge lp:~afrantzis/mir/fix-shutdown-with-blocked-clients-test
Reviewer Review Type Date Requested Status
Alberto Aguirre (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Robert Carr (community) Approve
Alan Griffiths Approve
Review via email: mp+225172@code.launchpad.net

Commit message

tests: Properly shut down blocked clients in ServerShutdown.server_can_shut_down_when_clients_are_blocked test

Properly shut down blocked clients to avoid memory errors and related races.

Description of the change

tests: Properly shut down blocked clients in ServerShutdown.server_can_shut_down_when_clients_are_blocked test

Properly shut down blocked clients to avoid memory errors and related races.

This has fixed various manifestations of problematic shut down scenarios locally, and is *probably* a fix for https://bugs.launchpad.net/mir/+bug/1335873 (which seems like another manifestation of the same core issue, but which I have not managed to reproduce locally exactly).

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The change is sensible, I can't demonstrate it actually relates to the linked bug though.

review: Approve
Revision history for this message
Robert Carr (robertcarr) wrote :

Ditto

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

Looks 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_server_shutdown.cpp'
2--- tests/acceptance-tests/test_server_shutdown.cpp 2014-06-14 19:52:52 +0000
3+++ tests/acceptance-tests/test_server_shutdown.cpp 2014-07-01 14:54:17 +0000
4@@ -158,6 +158,10 @@
5 std::shared_ptr<mtd::FakeEventHubInputConfiguration> input_configuration;
6 };
7
8+void null_lifecycle_callback(MirConnection*, MirLifecycleState, void*)
9+{
10+}
11+
12 }
13
14 using ServerShutdown = BespokeDisplayServerTestFixture;
15@@ -194,6 +198,9 @@
16
17 ASSERT_TRUE(connection != NULL);
18
19+ /* Default lifecycle handler terminates the process on disconnect, so override it */
20+ mir_connection_set_lifecycle_event_callback(connection, null_lifecycle_callback, nullptr);
21+
22 MirSurfaceParameters const request_params =
23 {
24 __PRETTY_FUNCTION__,
25@@ -213,13 +220,7 @@
26 next_buffer_done.set();
27 server_done.wait();
28
29- /*
30- * TODO: Releasing the connection to a shut down server blocks
31- * the client. We should handle unexpected server shutdown more
32- * gracefully on the client side.
33- *
34- * mir_connection_release(connection);
35- */
36+ mir_connection_release(connection);
37 }
38
39 Flag& next_buffer_done;

Subscribers

People subscribed via source and target branches