Mir

Merge lp:~alan-griffiths/mir/fix-1332011 into lp:mir

Proposed by Alan Griffiths
Status: Rejected
Rejected by: Alan Griffiths
Proposed branch: lp:~alan-griffiths/mir/fix-1332011
Merge into: lp:mir
Diff against target: 38 lines (+13/-8)
1 file modified
tests/acceptance-tests/test_client_cursor_api.cpp (+13/-8)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1332011
Reviewer Review Type Date Requested Status
Cemil Azizoglu (community) Approve
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Kevin DuBois (community) Approve
Review via email: mp+224124@code.launchpad.net

Commit message

tests: avoid a race between SurfaceObservingServerConfiguration::on_start() setting expectations and the client calls that satisfy the expectation.

Description of the change

tests: avoid a race between SurfaceObservingServerConfiguration::on_start() setting expectations and the client calls that satisfy the expectation.

To post a comment you must log in.
lp:~alan-griffiths/mir/fix-1332011 updated
1716. By Alan Griffiths

Remove unnecessary state

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/ports.ubuntu.com_ubuntu-ports_dists_utopic_main_binary-armhf_Packages Hash Sum mismatch

retriggering

Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Merge conflicts.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good (besides conflicts).

review: Approve
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

LGTM.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

This race was fixed in lp:~mir-team/mir/cursor-spike-phase-4-implement-api which landed in -r1717

Unmerged revisions

1716. By Alan Griffiths

Remove unnecessary state

1715. By Alan Griffiths

Avoid race between client connection and on_start()

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_cursor_api.cpp'
2--- tests/acceptance-tests/test_client_cursor_api.cpp 2014-06-19 00:02:28 +0000
3+++ tests/acceptance-tests/test_client_cursor_api.cpp 2014-06-23 13:34:34 +0000
4@@ -175,21 +175,26 @@
5 struct SurfaceObservingServerConfiguration : mtf::TestingServerConfiguration
6 {
7 SurfaceObservingServerConfiguration(std::function<void(MockSurfaceObserver&)> const& set_expectations)
8- : set_expectations(set_expectations),
9- observer(std::make_shared<MockSurfaceObserver>())
10+ : set_expectations(set_expectations)
11 {
12 }
13
14- void on_start() override
15+ std::shared_ptr<mir::compositor::Scene> the_scene() override
16 {
17- auto scene = the_scene();
18- scene->add_observer(std::make_shared<SurfaceObserverInstaller>(observer));
19-
20- set_expectations(*observer);
21+ return scene_cache([this]
22+ {
23+ auto const scene = mtf::TestingServerConfiguration::the_scene();
24+ auto const observer = std::make_shared<MockSurfaceObserver>();
25+
26+ set_expectations(*observer);
27+ scene->add_observer(std::make_shared<SurfaceObserverInstaller>(observer));
28+
29+ return scene;
30+ });
31 }
32
33 std::function<void(MockSurfaceObserver&)> const set_expectations;
34- std::shared_ptr<MockSurfaceObserver> const observer;
35+ mir::CachedPtr<mir::compositor::Scene> scene_cache;
36 };
37
38 typedef unsigned ClientCount;

Subscribers

People subscribed via source and target branches