Mir

Merge lp:mir/0.7 into lp:mir/ubuntu

Proposed by Andreas Pokorny
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 1913
Merged at revision: 1213
Proposed branch: lp:mir/0.7
Merge into: lp:mir/ubuntu
Diff against target: 512 lines (+201/-46)
14 files modified
CMakeLists.txt (+1/-1)
cmake/EnableCoverageReport.cmake (+26/-26)
debian/changelog (+14/-0)
debian/control (+0/-2)
include/test/mir_test/auto_unblock_thread.h (+2/-2)
include/test/mir_test/cross_process_action.h (+2/-1)
include/test/mir_test_framework/display_server_test_fixture.h (+1/-1)
include/test/mir_test_framework/testing_process_manager.h (+1/-1)
src/server/frontend/socket_messenger.cpp (+21/-5)
tests/acceptance-tests/CMakeLists.txt (+1/-0)
tests/acceptance-tests/test_unresponsive_client.cpp (+122/-0)
tests/mir_test/cross_process_action.cpp (+2/-2)
tests/mir_test_framework/display_server_test_fixture.cpp (+2/-2)
tests/mir_test_framework/testing_process_manager.cpp (+6/-3)
To merge this branch: bzr merge lp:mir/0.7
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Approve
Cemil Azizoglu (community) Approve
Review via email: mp+234796@code.launchpad.net

Commit message

Mir 0.7.3 release

Description of the change

Mir 0.7.3 release

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Incorrect version string:
  18 +mir (0.7.3) UNRELEASED; urgency=medium
As we're packaging for Ubuntu it should be something like 0.7.3-0ubuntu1 to start with.

If you create your changelog entry with the "dch -i" command it should set this for you.

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Arguably, r1910 should be mentioned in the changelog. Any change in a stable branch should be mentioned...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

LGTM.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I just noticed bug 1370866 in 0.7.2 on our build machines is blocking CI for some pending branches. We need to fix that one too.

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

Fix pushed to revision 1912. Just wait for Launchpad to update, then approved.

lp:mir/0.7 updated
1912. By Daniel van Vugt

Cherry pick bug fix LP: #1370866 from 0.8:

Relax dependencies on libmirplatform2. Any binary package that uses
libmirplatform2 should already be ABI compatible with any version of
libmirplatform2. Assuming we maintain our ABIs correctly...

Minimising exact version requirements should minimise future package
upgrade problems.

1913. By Andreas Pokorny

ping

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

*** No more changes ***

It's now in utopic-proposed: https://launchpad.net/ubuntu/+source/mir

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-09-12 08:11:02 +0000
+++ CMakeLists.txt 2014-09-18 14:48:06 +0000
@@ -28,7 +28,7 @@
2828
29set(MIR_VERSION_MAJOR 0)29set(MIR_VERSION_MAJOR 0)
30set(MIR_VERSION_MINOR 7) # This should change at least with every MIRSERVER_ABI30set(MIR_VERSION_MINOR 7) # This should change at least with every MIRSERVER_ABI
31set(MIR_VERSION_PATCH 2)31set(MIR_VERSION_PATCH 3)
3232
33set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH})33set(MIR_VERSION ${MIR_VERSION_MAJOR}.${MIR_VERSION_MINOR}.${MIR_VERSION_PATCH})
3434
3535
=== modified file 'cmake/EnableCoverageReport.cmake'
--- cmake/EnableCoverageReport.cmake 2013-01-15 16:01:51 +0000
+++ cmake/EnableCoverageReport.cmake 2014-09-18 14:48:06 +0000
@@ -14,7 +14,7 @@
14# The coverage report is based on gcov. Depending on the availability of lcov14# The coverage report is based on gcov. Depending on the availability of lcov
15# a HTML report will be generated and/or an XML report of gcovr is found.15# a HTML report will be generated and/or an XML report of gcovr is found.
16# The generated coverage target executes all found solutions. Special targets16# The generated coverage target executes all found solutions. Special targets
17# exist to create e.g. only the xml report: coverage-xml. 17# exist to create e.g. only the xml report: coverage-xml.
18#18#
19# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>19# Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de>
20#20#
@@ -36,16 +36,16 @@
36FIND_PACKAGE(gcovr)36FIND_PACKAGE(gcovr)
3737
38FUNCTION(ENABLE_COVERAGE_REPORT)38FUNCTION(ENABLE_COVERAGE_REPORT)
39 39
40 # argument parsing40 # argument parsing
41 PARSE_ARGUMENTS(ARG "FILTER;TARGETS;TESTS" "" ${ARGN})41 PARSE_ARGUMENTS(ARG "FILTER;TARGETS;TESTS" "" ${ARGN})
42 42
43 SET(COVERAGE_RAW_FILE "${CMAKE_BINARY_DIR}/coverage.raw.info")43 SET(COVERAGE_RAW_FILE "${CMAKE_BINARY_DIR}/coverage.raw.info")
44 SET(COVERAGE_FILTERED_FILE "${CMAKE_BINARY_DIR}/coverage.info")44 SET(COVERAGE_FILTERED_FILE "${CMAKE_BINARY_DIR}/coverage.info")
45 SET(COVERAGE_REPORT_DIR "${CMAKE_BINARY_DIR}/coveragereport")45 SET(COVERAGE_REPORT_DIR "${CMAKE_BINARY_DIR}/coveragereport")
46 SET(COVERAGE_XML_FILE "${CMAKE_BINARY_DIR}/coverage.xml")46 SET(COVERAGE_XML_FILE "${CMAKE_BINARY_DIR}/coverage.xml")
47 SET(COVERAGE_XML_COMMAND_FILE "${CMAKE_BINARY_DIR}/coverage-xml.cmake")47 SET(COVERAGE_XML_COMMAND_FILE "${CMAKE_BINARY_DIR}/coverage-xml.cmake")
48 48
49 # decide if there is any tool to create coverage data49 # decide if there is any tool to create coverage data
50 SET(TOOL_FOUND FALSE)50 SET(TOOL_FOUND FALSE)
51 IF(LCOV_FOUND OR GCOVR_FOUND)51 IF(LCOV_FOUND OR GCOVR_FOUND)
@@ -54,35 +54,35 @@
54 IF(NOT TOOL_FOUND)54 IF(NOT TOOL_FOUND)
55 MESSAGE(STATUS "Cannot enable coverage targets because neither lcov nor gcovr are found.")55 MESSAGE(STATUS "Cannot enable coverage targets because neither lcov nor gcovr are found.")
56 ENDIF()56 ENDIF()
57 57
58 STRING(TOLOWER "${CMAKE_BUILD_TYPE}" COVERAGE_BUILD_TYPE)58 STRING(TOLOWER "${CMAKE_BUILD_TYPE}" COVERAGE_BUILD_TYPE)
59 IF(CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND "${COVERAGE_BUILD_TYPE}" MATCHES "coverage")59 IF(CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND "${COVERAGE_BUILD_TYPE}" MATCHES "coverage")
60 60
61 MESSAGE(STATUS "Coverage support enabled for targets: ${ARG_TARGETS}")61 MESSAGE(STATUS "Coverage support enabled for targets: ${ARG_TARGETS}")
62 62
63 # create coverage build type63 # create coverage build type
64 SET(CMAKE_CXX_FLAGS_COVERAGE ${CMAKE_CXX_FLAGS_DEBUG} PARENT_SCOPE)64 SET(CMAKE_CXX_FLAGS_COVERAGE ${CMAKE_CXX_FLAGS_DEBUG} PARENT_SCOPE)
65 SET(CMAKE_C_FLAGS_COVERAGE ${CMAKE_C_FLAGS_DEBUG} PARENT_SCOPE)65 SET(CMAKE_C_FLAGS_COVERAGE ${CMAKE_C_FLAGS_DEBUG} PARENT_SCOPE)
66 SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} coverage PARENT_SCOPE)66 SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} coverage PARENT_SCOPE)
67 67
68 # instrument targets68 # instrument targets
69 SET_TARGET_PROPERTIES(${ARG_TARGETS} PROPERTIES COMPILE_FLAGS --coverage69 SET_TARGET_PROPERTIES(${ARG_TARGETS} PROPERTIES COMPILE_FLAGS --coverage
70 LINK_FLAGS --coverage)70 LINK_FLAGS --coverage)
71 71
72 # html report72 # html report
73 IF (LCOV_FOUND)73 IF (LCOV_FOUND)
74 74
75 MESSAGE(STATUS "Enabling HTML coverage report")75 MESSAGE(STATUS "Enabling HTML coverage report")
76 76
77 # set up coverage target77 # set up coverage target
78 78
79 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_RAW_FILE}79 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_RAW_FILE}
80 COMMAND ${LCOV_EXECUTABLE} -c -d ${CMAKE_BINARY_DIR} -o ${COVERAGE_RAW_FILE}80 COMMAND ${LCOV_EXECUTABLE} -c -d ${CMAKE_BINARY_DIR} -o ${COVERAGE_RAW_FILE}
81 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}81 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
82 COMMENT "Collecting coverage data"82 COMMENT "Collecting coverage data"
83 DEPENDS ${ARG_TARGETS} ${ARG_TESTS}83 DEPENDS ${ARG_TARGETS} ${ARG_TESTS}
84 VERBATIM)84 VERBATIM)
85 85
86 # filter unwanted stuff86 # filter unwanted stuff
87 LIST(LENGTH ARG_FILTER FILTER_LENGTH)87 LIST(LENGTH ARG_FILTER FILTER_LENGTH)
88 IF(${FILTER_LENGTH} GREATER 0)88 IF(${FILTER_LENGTH} GREATER 0)
@@ -94,7 +94,7 @@
94 ELSE()94 ELSE()
95 SET(FILTER "")95 SET(FILTER "")
96 ENDIF()96 ENDIF()
97 97
98 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_FILTERED_FILE}98 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_FILTERED_FILE}
99 COMMAND ${LCOV_EXECUTABLE} -e ${COVERAGE_RAW_FILE} "${CMAKE_SOURCE_DIR}*" -o ${COVERAGE_FILTERED_FILE}99 COMMAND ${LCOV_EXECUTABLE} -e ${COVERAGE_RAW_FILE} "${CMAKE_SOURCE_DIR}*" -o ${COVERAGE_FILTERED_FILE}
100 ${FILTER}100 ${FILTER}
@@ -107,34 +107,34 @@
107 DEPENDS ${COVERAGE_FILTERED_FILE}107 DEPENDS ${COVERAGE_FILTERED_FILE}
108 COMMENT "Generating HTML coverage report in ${COVERAGE_REPORT_DIR}"108 COMMENT "Generating HTML coverage report in ${COVERAGE_REPORT_DIR}"
109 VERBATIM)109 VERBATIM)
110 110
111 ADD_CUSTOM_TARGET(coverage-html111 ADD_CUSTOM_TARGET(coverage-html
112 DEPENDS ${COVERAGE_REPORT_DIR})112 DEPENDS ${COVERAGE_REPORT_DIR})
113 113
114 ENDIF()114 ENDIF()
115 115
116 # xml coverage report116 # xml coverage report
117 IF(GCOVR_FOUND)117 IF(GCOVR_FOUND)
118 118
119 MESSAGE(STATUS "Enabling XML coverage report")119 MESSAGE(STATUS "Enabling XML coverage report")
120 120
121 # gcovr cannot write directly to a file so the execution needs to121 # gcovr cannot write directly to a file so the execution needs to
122 # be wrapped in a cmake file that generates the file output122 # be wrapped in a cmake file that generates the file output
123 FILE(WRITE ${COVERAGE_XML_COMMAND_FILE}123 FILE(WRITE ${COVERAGE_XML_COMMAND_FILE}
124 "SET(ENV{LANG} en)\n")124 "SET(ENV{LANG} en)\n")
125 FILE(APPEND ${COVERAGE_XML_COMMAND_FILE}125 FILE(APPEND ${COVERAGE_XML_COMMAND_FILE}
126 "EXECUTE_PROCESS(COMMAND \"${GCOVR_EXECUTABLE}\" --exclude=3rd_party.* --exclude=tests.* --exclude=obj-.* --exclude=cmake.* --exclude=include.mir_test.* --exclude=include.mir_test_doubles.* --exclude=include.mir_test_framework.* -c \"${CMAKE_GCOV}\" -x -r \"${CMAKE_SOURCE_DIR}\" OUTPUT_FILE \"${COVERAGE_XML_FILE}\" WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\")\n")126 "EXECUTE_PROCESS(COMMAND \"${GCOVR_EXECUTABLE}\" --exclude=3rd_party.* --exclude=tests.* --exclude=obj-.* --exclude=cmake.* --exclude=include.mir_test.* --exclude=include.mir_test_doubles.* --exclude=include.mir_test_framework.* -x -r \"${CMAKE_BINARY_DIR}\" OUTPUT_FILE \"${COVERAGE_XML_FILE}\" WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\")\n")
127 127
128 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_XML_FILE}128 ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_XML_FILE}
129 COMMAND ${CMAKE_COMMAND} ARGS -P ${COVERAGE_XML_COMMAND_FILE}129 COMMAND ${CMAKE_COMMAND} ARGS -P ${COVERAGE_XML_COMMAND_FILE}
130 COMMENT "Generating coverage XML report"130 COMMENT "Generating coverage XML report"
131 VERBATIM)131 VERBATIM)
132 132
133 ADD_CUSTOM_TARGET(coverage-xml133 ADD_CUSTOM_TARGET(coverage-xml
134 DEPENDS ${COVERAGE_XML_FILE})134 DEPENDS ${COVERAGE_XML_FILE})
135 135
136 ENDIF()136 ENDIF()
137 137
138 # provide a global coverage target executing both steps if available138 # provide a global coverage target executing both steps if available
139 SET(GLOBAL_DEPENDS "")139 SET(GLOBAL_DEPENDS "")
140 IF(LCOV_FOUND)140 IF(LCOV_FOUND)
@@ -147,7 +147,7 @@
147 ADD_CUSTOM_TARGET(coverage147 ADD_CUSTOM_TARGET(coverage
148 DEPENDS ${GLOBAL_DEPENDS})148 DEPENDS ${GLOBAL_DEPENDS})
149 ENDIF()149 ENDIF()
150 150
151 ENDIF()151 ENDIF()
152152
153ENDFUNCTION() 153ENDFUNCTION()
154154
=== modified file 'debian/changelog'
--- debian/changelog 2014-09-12 09:07:49 +0000
+++ debian/changelog 2014-09-18 14:48:06 +0000
@@ -1,3 +1,17 @@
1mir (0.7.3-0ubuntu1) UNRELEASED; urgency=medium
2
3 [ Andreas Pokorny ]
4 * New upstream release 0.7.3 (https://launchpad.net/mir/+milestone/0.7.3)
5 - Bug fixes
6 . Fix constructor syntax errors (LP: #1369389)
7 . server: Workaround for unresponsive clients causing the server to hang
8 (LP: #1350207)
9 . Relax strict dependencies of graphics drivers on an exact version
10 of the libmirplatform2 package. It's blocking CI. (LP: #1370866)
11 . Update cmake scripts to current version of gcovr.
12
13 -- Daniel van Vugt <daniel.van.vugt@canonical.com> Wed, 17 Sep 2014 11:23:23 +0800
14
1mir (0.7.2+14.10.20140912-0ubuntu1) utopic; urgency=medium15mir (0.7.2+14.10.20140912-0ubuntu1) utopic; urgency=medium
216
3 [ Alexandros Frantzis ]17 [ Alexandros Frantzis ]
418
=== modified file 'debian/control'
--- debian/control 2014-08-26 14:59:57 +0000
+++ debian/control 2014-09-18 14:48:06 +0000
@@ -80,7 +80,6 @@
80Pre-Depends: ${misc:Pre-Depends}80Pre-Depends: ${misc:Pre-Depends}
81Depends: ${misc:Depends},81Depends: ${misc:Depends},
82 ${shlibs:Depends},82 ${shlibs:Depends},
83 libmirplatform2 (= ${binary:Version}),
84Description: Display server for Ubuntu - platform library for Mesa83Description: Display server for Ubuntu - platform library for Mesa
85 Mir is a display server running on linux systems, with a focus on efficiency,84 Mir is a display server running on linux systems, with a focus on efficiency,
86 robust operation and a well-defined driver model.85 robust operation and a well-defined driver model.
@@ -95,7 +94,6 @@
95Pre-Depends: ${misc:Pre-Depends}94Pre-Depends: ${misc:Pre-Depends}
96Depends: ${misc:Depends},95Depends: ${misc:Depends},
97 ${shlibs:Depends},96 ${shlibs:Depends},
98 libmirplatform2 (= ${binary:Version}),
99Description: Display server for Ubuntu - platform library for Android97Description: Display server for Ubuntu - platform library for Android
100 Mir is a display server running on linux systems, with a focus on efficiency,98 Mir is a display server running on linux systems, with a focus on efficiency,
101 robust operation and a well-defined driver model.99 robust operation and a well-defined driver model.
102100
=== modified file 'include/test/mir_test/auto_unblock_thread.h'
--- include/test/mir_test/auto_unblock_thread.h 2014-07-21 03:35:31 +0000
+++ include/test/mir_test/auto_unblock_thread.h 2014-09-18 14:48:06 +0000
@@ -41,7 +41,7 @@
41 explicit AutoUnblockThread(std::function<void(void)> const& unblock,41 explicit AutoUnblockThread(std::function<void(void)> const& unblock,
42 Callable&& f,42 Callable&& f,
43 Args&&... args)43 Args&&... args)
44 : unblock{unblock}, thread{f, args...}44 : unblock{unblock}, thread(f, args...)
45 {}45 {}
4646
47 ~AutoUnblockThread()47 ~AutoUnblockThread()
@@ -75,7 +75,7 @@
75 template<typename Callable, typename... Args>75 template<typename Callable, typename... Args>
76 explicit AutoJoinThread(Callable&& f,76 explicit AutoJoinThread(Callable&& f,
77 Args&&... args)77 Args&&... args)
78 : AutoUnblockThread{[]{}, f, args...}78 : AutoUnblockThread([]{}, f, args...)
79 {}79 {}
80};80};
8181
8282
=== modified file 'include/test/mir_test/cross_process_action.h'
--- include/test/mir_test/cross_process_action.h 2013-08-20 13:39:31 +0000
+++ include/test/mir_test/cross_process_action.h 2014-09-18 14:48:06 +0000
@@ -23,6 +23,7 @@
23#include "mir_test_framework/cross_process_sync.h"23#include "mir_test_framework/cross_process_sync.h"
2424
25#include <functional>25#include <functional>
26#include <chrono>
2627
27namespace mir28namespace mir
28{29{
@@ -33,7 +34,7 @@
33{34{
34public:35public:
35 void exec(std::function<void()> const& f);36 void exec(std::function<void()> const& f);
36 void operator()();37 void operator()(std::chrono::milliseconds timeout = std::chrono::milliseconds{-1});
3738
38private:39private:
39 mir_test_framework::CrossProcessSync start_sync;40 mir_test_framework::CrossProcessSync start_sync;
4041
=== modified file 'include/test/mir_test_framework/display_server_test_fixture.h'
--- include/test/mir_test_framework/display_server_test_fixture.h 2014-08-26 14:47:50 +0000
+++ include/test/mir_test_framework/display_server_test_fixture.h 2014-09-18 14:48:06 +0000
@@ -62,7 +62,7 @@
6262
63 void launch_server_process(TestingServerConfiguration& config);63 void launch_server_process(TestingServerConfiguration& config);
6464
65 void launch_client_process(TestingClientConfiguration& config);65 pid_t launch_client_process(TestingClientConfiguration& config);
6666
67 bool shutdown_server_process();67 bool shutdown_server_process();
68 Result wait_for_shutdown_server_process();68 Result wait_for_shutdown_server_process();
6969
=== modified file 'include/test/mir_test_framework/testing_process_manager.h'
--- include/test/mir_test_framework/testing_process_manager.h 2014-08-26 14:47:50 +0000
+++ include/test/mir_test_framework/testing_process_manager.h 2014-09-18 14:48:06 +0000
@@ -51,7 +51,7 @@
51 ~TestingProcessManager();51 ~TestingProcessManager();
5252
53 void launch_server_process(TestingServerConfiguration& config);53 void launch_server_process(TestingServerConfiguration& config);
54 void launch_client_process(TestingClientConfiguration& config,54 pid_t launch_client_process(TestingClientConfiguration& config,
55 mir::options::Option const& test_options);55 mir::options::Option const& test_options);
5656
57 void tear_down_clients();57 void tear_down_clients();
5858
=== modified file 'src/server/frontend/socket_messenger.cpp'
--- src/server/frontend/socket_messenger.cpp 2014-07-24 18:35:40 +0000
+++ src/server/frontend/socket_messenger.cpp 2014-09-18 14:48:06 +0000
@@ -36,6 +36,14 @@
36mfd::SocketMessenger::SocketMessenger(std::shared_ptr<ba::local::stream_protocol::socket> const& socket)36mfd::SocketMessenger::SocketMessenger(std::shared_ptr<ba::local::stream_protocol::socket> const& socket)
37 : socket(socket)37 : socket(socket)
38{38{
39 // Make the socket non-blocking to avoid hanging the server when a client
40 // is unresponsive. Also increase the send buffer size to 64KiB to allow
41 // more leeway for transient client freezes.
42 // See https://bugs.launchpad.net/mir/+bug/1350207
43 // TODO: Rework the messenger to support asynchronous sends
44 socket->non_blocking(true);
45 boost::asio::socket_base::send_buffer_size option(64*1024);
46 socket->set_option(option);
39}47}
4048
41mf::SessionCredentials mfd::SocketMessenger::creator_creds() const49mf::SessionCredentials mfd::SocketMessenger::creator_creds() const
@@ -143,11 +151,19 @@
143 ba::mutable_buffers_1 const& buffer)151 ba::mutable_buffers_1 const& buffer)
144{152{
145 bs::error_code e;153 bs::error_code e;
146 boost::asio::read(154 size_t nread = 0;
147 *socket,155
148 buffer,156 while (nread < ba::buffer_size(buffer))
149 boost::asio::transfer_exactly(ba::buffer_size(buffer)),157 {
150 e);158 nread += boost::asio::read(
159 *socket,
160 ba::mutable_buffers_1{buffer + nread},
161 e);
162
163 if (e && e != ba::error::would_block)
164 break;
165 }
166
151 return e;167 return e;
152}168}
153169
154170
=== modified file 'tests/acceptance-tests/CMakeLists.txt'
--- tests/acceptance-tests/CMakeLists.txt 2014-08-29 13:23:12 +0000
+++ tests/acceptance-tests/CMakeLists.txt 2014-09-18 14:48:06 +0000
@@ -46,6 +46,7 @@
46 test_server_without_active_outputs.cpp46 test_server_without_active_outputs.cpp
47 test_client_input.cpp47 test_client_input.cpp
48 test_server_startup.cpp48 test_server_startup.cpp
49 test_unresponsive_client.cpp
49 ${GENERATED_PROTOBUF_SRCS}50 ${GENERATED_PROTOBUF_SRCS}
50 ${GENERATED_PROTOBUF_HDRS}51 ${GENERATED_PROTOBUF_HDRS}
51)52)
5253
=== added file 'tests/acceptance-tests/test_unresponsive_client.cpp'
--- tests/acceptance-tests/test_unresponsive_client.cpp 1970-01-01 00:00:00 +0000
+++ tests/acceptance-tests/test_unresponsive_client.cpp 2014-09-18 14:48:06 +0000
@@ -0,0 +1,122 @@
1/*
2 * Copyright © 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */
18
19#include "src/server/scene/session_container.h"
20#include "mir/scene/session.h"
21#include "mir/scene/surface.h"
22
23#include "mir_test/cross_process_action.h"
24#include "mir_test_framework/display_server_test_fixture.h"
25
26#include "mir_toolkit/mir_client_library.h"
27
28#include <gtest/gtest.h>
29
30#include <string>
31#include <thread>
32
33namespace mt = mir::test;
34namespace mtf = mir_test_framework;
35
36namespace
37{
38char const* const mir_test_socket = mtf::test_socket_file().c_str();
39}
40using UnresponsiveClient = mtf::BespokeDisplayServerTestFixture;
41
42TEST_F(UnresponsiveClient, does_not_hang_server)
43{
44 struct ServerConfig : TestingServerConfiguration
45 {
46 void on_start() override
47 {
48 std::thread(
49 [this]
50 {
51 send_events.exec(
52 [this]
53 {
54 auto const sessions = the_session_container();
55
56 for (int i = 0; i < 1000; ++i)
57 {
58 sessions->for_each(
59 [i] (std::shared_ptr<mir::scene::Session> const& session)
60 {
61 session->default_surface()->resize({i + 1, i + 1});
62 });
63 }
64 });
65 }).detach();
66 }
67 mt::CrossProcessAction send_events;
68 } server_config;
69
70 launch_server_process(server_config);
71
72 struct ClientConfig : TestingClientConfiguration
73 {
74 void exec()
75 {
76 MirConnection* connection = nullptr;
77 MirSurface* surface = nullptr;
78
79 connect.exec(
80 [&]
81 {
82 connection = mir_connect_sync(mir_test_socket, __PRETTY_FUNCTION__);
83
84 MirSurfaceParameters const request_params =
85 {
86 __PRETTY_FUNCTION__,
87 100, 100,
88 mir_pixel_format_abgr_8888,
89 mir_buffer_usage_hardware,
90 mir_display_output_id_invalid
91 };
92 surface = mir_connection_create_surface_sync(connection, &request_params);
93 });
94
95 release.exec(
96 [&]
97 {
98 // We would normally explicitly release the surface at this
99 // point. However, because we have been filling the server
100 // send socket buffer, releasing the surface may cause the
101 // server to try to write to a full socket buffer when
102 // responding, leading the server to believe that the client
103 // is blocked, and causing a premature client disconnection.
104 mir_connection_release(connection);
105 });
106 }
107
108 mt::CrossProcessAction connect;
109 mt::CrossProcessAction release;
110 } client_config;
111
112 auto const client_pid = launch_client_process(client_config);
113
114 run_in_test_process([&]
115 {
116 client_config.connect();
117 kill(client_pid, SIGSTOP);
118 server_config.send_events(std::chrono::seconds{10});
119 kill(client_pid, SIGCONT);
120 client_config.release();
121 });
122}
0123
=== modified file 'tests/mir_test/cross_process_action.cpp'
--- tests/mir_test/cross_process_action.cpp 2013-08-20 13:39:31 +0000
+++ tests/mir_test/cross_process_action.cpp 2014-09-18 14:48:06 +0000
@@ -27,8 +27,8 @@
27 finish_sync.signal_ready();27 finish_sync.signal_ready();
28}28}
2929
30void mt::CrossProcessAction::operator()()30void mt::CrossProcessAction::operator()(std::chrono::milliseconds timeout)
31{31{
32 start_sync.signal_ready();32 start_sync.signal_ready();
33 finish_sync.wait_for_signal_ready();33 finish_sync.wait_for_signal_ready_for(timeout);
34}34}
3535
=== modified file 'tests/mir_test_framework/display_server_test_fixture.cpp'
--- tests/mir_test_framework/display_server_test_fixture.cpp 2014-08-26 14:47:50 +0000
+++ tests/mir_test_framework/display_server_test_fixture.cpp 2014-09-18 14:48:06 +0000
@@ -60,9 +60,9 @@
60 process_manager.launch_server_process(functor);60 process_manager.launch_server_process(functor);
61}61}
6262
63void BespokeDisplayServerTestFixture::launch_client_process(TestingClientConfiguration& config)63pid_t BespokeDisplayServerTestFixture::launch_client_process(TestingClientConfiguration& config)
64{64{
65 process_manager.launch_client_process(config, *test_options);65 return process_manager.launch_client_process(config, *test_options);
66}66}
6767
68bool BespokeDisplayServerTestFixture::shutdown_server_process()68bool BespokeDisplayServerTestFixture::shutdown_server_process()
6969
=== modified file 'tests/mir_test_framework/testing_process_manager.cpp'
--- tests/mir_test_framework/testing_process_manager.cpp 2014-08-26 14:47:50 +0000
+++ tests/mir_test_framework/testing_process_manager.cpp 2014-09-18 14:48:06 +0000
@@ -73,15 +73,16 @@
73 }73 }
74}74}
7575
76void mtf::TestingProcessManager::launch_client_process(TestingClientConfiguration& config, mo::Option const& test_options)76pid_t mtf::TestingProcessManager::launch_client_process(TestingClientConfiguration& config, mo::Option const& test_options)
77{77{
78 if (!is_test_process)78 if (!is_test_process)
79 {79 {
80 return; // We're not in the test process, so just return gracefully80 return 0; // We're not in the test process, so just return gracefully
81 }81 }
8282
83 // We're in the test process, so make sure we started a service83 // We're in the test process, so make sure we started a service
84 ASSERT_TRUE(server_process_was_started);84 if (!server_process_was_started)
85 throw std::runtime_error("Trying to launch client process, but server process has not started");
8586
86 pid_t pid = fork();87 pid_t pid = fork();
8788
@@ -121,6 +122,8 @@
121 {122 {
122 clients.push_back(std::shared_ptr<Process>(new Process(pid)));123 clients.push_back(std::shared_ptr<Process>(new Process(pid)));
123 }124 }
125
126 return pid;
124}127}
125128
126void mtf::TestingProcessManager::tear_down_clients()129void mtf::TestingProcessManager::tear_down_clients()

Subscribers

People subscribed via source and target branches

to all changes: