Mir

Merge lp:~albaguirre/mir/tweak-failing-tests-ci-tsan into lp:mir

Proposed by Alberto Aguirre on 2015-07-10
Status: Merged
Approved by: Daniel van Vugt on 2015-07-14
Approved revision: no longer in the source branch.
Merged at revision: 2743
Proposed branch: lp:~albaguirre/mir/tweak-failing-tests-ci-tsan
Merge into: lp:mir
Diff against target: 146 lines (+32/-38)
4 files modified
cmake/MirCommon.cmake (+1/-1)
tests/unit-tests/compositor/test_buffer_queue.cpp (+1/-1)
tests/unit-tests/graphics/mesa/kms/test_display.cpp (+28/-34)
tests/unit-tests/test_glib_main_loop.cpp (+2/-2)
To merge this branch: bzr merge lp:~albaguirre/mir/tweak-failing-tests-ci-tsan
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve on 2015-07-14
PS Jenkins bot continuous-integration Approve on 2015-07-14
Cemil Azizoglu (community) 2015-07-10 Approve on 2015-07-13
Review via email: mp+264463@code.launchpad.net

Commit Message

Tweak failing tests under CI Thread sanitizer builds

Description of the Change

Tweak failing tests under CI Thread sanitizer builds

To post a comment you must log in.
2737. By Daniel van Vugt on 2015-07-13

Unhide wrapped binaries, and use the more common wrapped binary naming
convention of ".bin".

Although this change only affects what developers see in the build tree,
I think it's useful to be able to see the real binaries you just built.
And to be able to type their names more easily. ;).

Approved by Cemil Azizoglu, PS Jenkins bot.

2738. By Daniel van Vugt on 2015-07-13

Improved shared library loading error messages to include the path
that can't be found. Instead of simply "No such file or directory",
you will now see "/the/path/tried/: No such file or directory".
(LP: #1473268)
. Fixes: https://bugs.launchpad.net/bugs/1473268.

Approved by Robert Ancell, Cemil Azizoglu, PS Jenkins bot.

2739. By Alberto Aguirre on 2015-07-13

logger: flush after every newline.

This does not impact tty output performance as it already flushes on every new line. Fixes: https://bugs.launchpad.net/bugs/1470204.

Approved by PS Jenkins bot, Cemil Azizoglu, Daniel van Vugt.

2740. By Daniel van Vugt on 2015-07-13

Bump the server ABI to 33. It seems we've already broken the server
ABI with virtual function table changes introduced in r2730:
  include/server/mir/frontend/session_mediator_report.h.

Approved by Cemil Azizoglu, PS Jenkins bot.

2741. By Kevin DuBois on 2015-07-13

fixes lp: #1471858. Fixes: https://bugs.launchpad.net/bugs/1471858.

Approved by PS Jenkins bot, Cemil Azizoglu, Daniel van Vugt.

Cemil Azizoglu (cemil-azizoglu) wrote :

ok

review: Approve
Alberto Aguirre (albaguirre) wrote :

Well it passes now:
http://s-jenkins.ubuntu-ci:8080/job/mir-clang-ts-wily-amd64-build/5/console

Once this MP is merged we can enable the mir-clang-ts-wily-amd64-build job on all MP's CI runs.

Daniel van Vugt (vanvugt) wrote :

The intermediate diff for the revision made sense but this final overall diff seems unnecessary:

21 - ASSERT_THAT(client_frames, Gt(compose_frames * 0.8f));
22 + ASSERT_THAT(client_frames, Gt(compose_frames * 0.80f));

review: Approve
2742. By Cemil Azizoglu on 2015-07-14

Use command line options during platform probe.

Approved by PS Jenkins bot, Chris Halse Rogers, Alexandros Frantzis.

2743. By Alberto Aguirre on 2015-07-14

Tweak failing tests under CI Thread sanitizer builds.

Approved by Daniel van Vugt, PS Jenkins bot, Cemil Azizoglu.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake/MirCommon.cmake'
2--- cmake/MirCommon.cmake 2015-07-10 08:23:21 +0000
3+++ cmake/MirCommon.cmake 2015-07-13 22:36:24 +0000
4@@ -67,7 +67,7 @@
5 # TSan does not support multi-threaded fork
6 # TSan may open fds so "surface_creation_does_not_leak_fds" will not work as written
7 # TSan deadlocks when running StreamTransportTest/0.SendsFullMessagesWhenInterrupted - disable it until understood
8- set(test_exclusion_filter "UnresponsiveClient.does_not_hang_server:DemoInProcessServerWithStubClientPlatform.surface_creation_does_not_leak_fds:StreamTransportTest/0.SendsFullMessagesWhenInterrupted")
9+ set(test_exclusion_filter "UnresponsiveClient.does_not_hang_server:DemoInProcessServerWithStubClientPlatform.surface_creation_does_not_leak_fds:StreamTransportTest/0.SendsFullMessagesWhenInterrupted:BufferQueue/WithTwoOrMoreBuffers.client_framerate_matches_compositor*:BufferQueue/WithThreeOrMoreBuffers.slow_client_framerate_matches_compositor*:BufferQueue/WithThreeOrMoreBuffers.queue_size_scales_with_client_performance*")
10 endif()
11
12 # Final commands
13
14=== modified file 'tests/unit-tests/compositor/test_buffer_queue.cpp'
15--- tests/unit-tests/compositor/test_buffer_queue.cpp 2015-07-02 18:01:28 +0000
16+++ tests/unit-tests/compositor/test_buffer_queue.cpp 2015-07-13 22:36:24 +0000
17@@ -921,7 +921,7 @@
18 monitor1.stop();
19
20 // Roughly compose_frames == client_frames within 20%
21- ASSERT_THAT(client_frames, Gt(compose_frames * 0.8f));
22+ ASSERT_THAT(client_frames, Gt(compose_frames * 0.80f));
23 ASSERT_THAT(client_frames, Lt(compose_frames * 1.2f));
24 }
25
26
27=== modified file 'tests/unit-tests/graphics/mesa/kms/test_display.cpp'
28--- tests/unit-tests/graphics/mesa/kms/test_display.cpp 2015-06-29 03:29:31 +0000
29+++ tests/unit-tests/graphics/mesa/kms/test_display.cpp 2015-07-13 22:36:24 +0000
30@@ -43,6 +43,8 @@
31
32 #include "mir_test_framework/udev_environment.h"
33 #include "mir/test/fake_shared.h"
34+#include "mir/test/auto_unblock_thread.h"
35+#include "mir/test/signal.h"
36
37 #include <gtest/gtest.h>
38 #include <memory>
39@@ -59,6 +61,7 @@
40 namespace mtd=mir::test::doubles;
41 namespace mtf=mir_test_framework;
42 namespace mr=mir::report;
43+namespace mt=mir::test;
44
45 namespace
46 {
47@@ -727,53 +730,44 @@
48 auto display = create_display(create_platform());
49
50 mir::GLibMainLoop ml{std::make_shared<mir::time::SteadyClock>()};
51- std::condition_variable done;
52+ mir::test::Signal done;
53
54 int const device_add_count{1};
55 int const device_change_count{10};
56 int const expected_call_count{device_add_count + device_change_count};
57- int call_count{0};
58- std::mutex m;
59+ std::atomic<int> call_count{0};
60
61 display->register_configuration_change_handler(
62 ml,
63- [&call_count, &ml, &done, &m]()
64+ [&call_count, &ml, &done]()
65 {
66- std::unique_lock<std::mutex> lock(m);
67 if (++call_count == expected_call_count)
68 {
69- ml.stop();
70- done.notify_all();
71+ done.raise();
72 }
73 });
74
75- std::thread t{
76- [this]
77- {
78- auto const syspath = fake_devices.add_device("drm", "card2", NULL, {}, {"DEVTYPE", "drm_minor"});
79-
80- for (int i = 0; i != device_change_count; ++i)
81- {
82- // sleeping between calls to fake_devices hides race conditions
83- std::this_thread::sleep_for(std::chrono::microseconds{500});
84- fake_devices.emit_device_changed(syspath);
85- }
86- }};
87-
88- std::thread watchdog{
89- [this, &done, &m, &ml, &call_count]
90- {
91- std::unique_lock<std::mutex> lock(m);
92- if (!done.wait_for(lock, std::chrono::seconds{1}, [&call_count]() { return call_count == expected_call_count; }))
93- ml.stop();
94- }
95- };
96-
97- ml.run();
98-
99- t.join();
100- watchdog.join();
101-
102+ auto mainloop_started = std::make_shared<mt::Signal>();
103+
104+ auto fire_on_mainloop_start = ml.create_alarm([mainloop_started]()
105+ {
106+ mainloop_started->raise();
107+ });
108+ fire_on_mainloop_start->reschedule_in(std::chrono::milliseconds{0});
109+
110+ mt::AutoUnblockThread mainLoopThread([&ml]{ml.stop();}, [&ml]{ml.run();});
111+ ASSERT_TRUE(mainloop_started->wait_for(std::chrono::milliseconds{100}));
112+
113+ auto const syspath = fake_devices.add_device("drm", "card2", NULL, {}, {"DEVTYPE", "drm_minor"});
114+
115+ for (int i = 0; i != device_change_count; ++i)
116+ {
117+ // sleeping between calls to fake_devices hides race conditions
118+ std::this_thread::sleep_for(std::chrono::microseconds{500});
119+ fake_devices.emit_device_changed(syspath);
120+ }
121+
122+ done.wait_for(std::chrono::seconds{10});
123 EXPECT_EQ(expected_call_count, call_count);
124 }
125
126
127=== modified file 'tests/unit-tests/test_glib_main_loop.cpp'
128--- tests/unit-tests/test_glib_main_loop.cpp 2015-06-25 03:00:08 +0000
129+++ tests/unit-tests/test_glib_main_loop.cpp 2015-07-13 22:36:24 +0000
130@@ -121,7 +121,7 @@
131
132 ml.stop();
133
134- EXPECT_TRUE(loop_finished.wait_for(std::chrono::seconds{10}));
135+ EXPECT_TRUE(loop_finished.wait_for(std::chrono::seconds{20}));
136 }
137
138 TEST_F(GLibMainLoopTest, ignores_handler_added_after_stop)
139@@ -1107,7 +1107,7 @@
140 auto alarm = ml.create_alarm([&]{ notification_called.raise(); });
141 alarm->reschedule_in(std::chrono::milliseconds{0});
142
143- EXPECT_TRUE(notification_called.wait_for(std::chrono::seconds{5}));
144+ EXPECT_TRUE(notification_called.wait_for(std::chrono::seconds{15}));
145 }
146 }
147

Subscribers

People subscribed via source and target branches