Merge lp:~marcustomlinson/unity-scopes-shell/relax-harness-timeouts into lp:unity-scopes-shell

Proposed by Marcus Tomlinson on 2016-08-31
Status: Merged
Approved by: Paweł Stołowski on 2016-09-13
Approved revision: 352
Merged at revision: 340
Proposed branch: lp:~marcustomlinson/unity-scopes-shell/relax-harness-timeouts
Merge into: lp:unity-scopes-shell
Diff against target: 310 lines (+48/-27)
13 files modified
CMakeLists.txt (+1/-1)
debian/changelog (+6/-0)
debian/control (+1/-1)
debian/control.in (+1/-1)
src/scope-harness/preview/preview-widget.cpp (+1/-1)
src/scope-harness/registry/custom-registry.cpp (+15/-2)
src/scope-harness/results/result.cpp (+1/-1)
src/scope-harness/scope-harness.cpp (+2/-2)
src/scope-harness/test-utils.cpp (+8/-8)
src/scope-harness/test-utils.h (+2/-0)
src/scope-harness/view/preview-view.cpp (+1/-1)
src/scope-harness/view/results-view.cpp (+8/-8)
src/scope-harness/view/settings-view.cpp (+1/-1)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-shell/relax-harness-timeouts
Reviewer Review Type Date Requested Status
Paweł Stołowski 2016-08-31 Approve on 2016-09-13
unity-api-1-bot continuous-integration Needs Fixing on 2016-09-12
Review via email: mp+304459@code.launchpad.net

Commit message

Increase scope-harness timeouts to fix flaky scope tests (incl. autopkg) on slow builders.

To post a comment you must log in.
unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
Paweł Stołowski (stolowski) wrote :

Looks good, thanks for looking at it! Even if it only improves the situation and doesn't fix all the test flakiness, it's definately worth having! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-05-31 09:31:57 +0000
3+++ CMakeLists.txt 2016-09-08 08:53:48 +0000
4@@ -51,7 +51,7 @@
5 find_package(Qt5Test)
6 find_package(Boost COMPONENTS regex REQUIRED)
7
8-pkg_check_modules(SCOPESLIB REQUIRED libunity-scopes>=1.0.5)
9+pkg_check_modules(SCOPESLIB REQUIRED libunity-scopes>=1.0.7)
10 pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=12)
11
12 pkg_check_modules(GSETTINGSQT REQUIRED gsettings-qt)
13
14=== modified file 'debian/changelog'
15--- debian/changelog 2016-08-10 14:55:34 +0000
16+++ debian/changelog 2016-09-08 08:53:48 +0000
17@@ -1,3 +1,9 @@
18+unity-scopes-shell (0.5.8-0ubuntu1) UNRELEASED; urgency=medium
19+
20+ * Increase scope-harness timeouts to assist scope testing on slow builders.
21+
22+ -- Marcus Tomlinson <marcus.tomlinson@canonical.com> Thu, 08 Sep 2016 10:47:19 +0200
23+
24 unity-scopes-shell (0.5.7+16.10.20160624.2-0ubuntu2) yakkety; urgency=medium
25
26 * No-change rebuild for boost soname change.
27
28=== modified file 'debian/control'
29--- debian/control 2016-06-15 20:18:25 +0000
30+++ debian/control 2016-09-08 08:53:48 +0000
31@@ -9,7 +9,7 @@
32 libboost-python-dev,
33 libboost-regex-dev,
34 libunity-api-dev (>= 7.111),
35- libunity-scopes-dev (>= 1.0.5~),
36+ libunity-scopes-dev (>= 1.0.7~),
37 libgsettings-qt-dev (>= 0.1),
38 libqtdbustest1-dev (>= 0.2),
39 libqtdbusmock1-dev (>= 0.2),
40
41=== modified file 'debian/control.in'
42--- debian/control.in 2016-05-31 09:31:57 +0000
43+++ debian/control.in 2016-09-08 08:53:48 +0000
44@@ -9,7 +9,7 @@
45 libboost-python-dev,
46 libboost-regex-dev,
47 libunity-api-dev (>= 7.111),
48- libunity-scopes-dev (>= 1.0.5~),
49+ libunity-scopes-dev (>= 1.0.7~),
50 libgsettings-qt-dev (>= 0.1),
51 libqtdbustest1-dev (>= 0.2),
52 libqtdbusmock1-dev (>= 0.2),
53
54=== modified file 'src/scope-harness/preview/preview-widget.cpp'
55--- src/scope-harness/preview/preview-widget.cpp 2016-02-17 15:49:37 +0000
56+++ src/scope-harness/preview/preview-widget.cpp 2016-09-08 08:53:48 +0000
57@@ -160,7 +160,7 @@
58
59 TestUtils::throwIfNot(p->m_previewModel->processingAction(), "Should be processing action");
60 QSignalSpy spy(p->m_previewModel, SIGNAL(processingActionChanged()));
61- TestUtils::throwIfNot(spy.wait(), "Processing action property didn't change");
62+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Processing action property didn't change");
63 TestUtils::throwIf(p->m_previewModel->processingAction(), "Should have finished processing action");
64
65 view::PreviewView::SPtr previewView = p->m_previewView.lock();
66
67=== modified file 'src/scope-harness/registry/custom-registry.cpp'
68--- src/scope-harness/registry/custom-registry.cpp 2015-08-19 13:19:22 +0000
69+++ src/scope-harness/registry/custom-registry.cpp 2016-09-08 08:53:48 +0000
70@@ -38,6 +38,11 @@
71 namespace
72 {
73
74+const static int c_processTimeout = 60000;
75+const static int c_twoWayTimeout = 60000;
76+const static int c_locateTimeout = 60000;
77+const static int c_registryTimeout = 60000;
78+
79 const static QString RUNTIME_CONFIG = R"(
80 [Runtime]
81 Registry.Identity = Registry
82@@ -55,11 +60,15 @@
83 Scope.InstallDir = %3
84 Click.InstallDir = %4
85 OEM.InstallDir = %5
86+Process.Timeout = %6
87 )";
88
89 const static QString MW_CONFIG = R"(
90 [Zmq]
91 EndpointDir = %1
92+Default.Twoway.Timeout = %2
93+Locate.Timeout = %3
94+Registry.Timeout = %4
95 )";
96
97 }
98@@ -218,10 +227,14 @@
99 .arg(scopeRunnerBin.fileName())
100 .arg(scopeInstallDir.path())
101 .arg(clickInstallDir.path())
102- .arg(oemInstallDir.path());
103+ .arg(oemInstallDir.path())
104+ .arg(c_processTimeout);
105
106 QString mwIni = MW_CONFIG
107- .arg(endpointsDir.path());
108+ .arg(endpointsDir.path())
109+ .arg(c_twoWayTimeout)
110+ .arg(c_locateTimeout)
111+ .arg(c_registryTimeout);
112
113 runtimeConfig.write(runtimeIni.toUtf8());
114 registryConfig.write(registryIni.toUtf8());
115
116=== modified file 'src/scope-harness/results/result.cpp'
117--- src/scope-harness/results/result.cpp 2016-02-17 15:49:37 +0000
118+++ src/scope-harness/results/result.cpp 2016-09-08 08:53:48 +0000
119@@ -105,7 +105,7 @@
120
121 if (spy.empty())
122 {
123- TestUtils::throwIfNot(spy.wait(), "Scope activation signal failed to emit");
124+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Scope activation signal failed to emit");
125 }
126
127 QVariantList response = spy.front();
128
129=== modified file 'src/scope-harness/scope-harness.cpp'
130--- src/scope-harness/scope-harness.cpp 2015-03-10 11:23:01 +0000
131+++ src/scope-harness/scope-harness.cpp 2016-09-08 08:53:48 +0000
132@@ -87,7 +87,7 @@
133
134 // wait till the registry spawns
135 QSignalSpy spy(p->m_scopes.get(), SIGNAL(loadedChanged()));
136- TestUtils::throwIfNot(spy.wait(), "Scopes failed to initalize");
137+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Scopes failed to initalize");
138
139 TestUtils::throwIf(p->m_scopes->rowCount() == 0 || !p->m_scopes->loaded(), "No scopes loaded");
140
141@@ -98,7 +98,7 @@
142 QSignalSpy spy(scope.data(), SIGNAL(searchInProgressChanged()));
143 if (scope->searchInProgress())
144 {
145- TestUtils::throwIfNot(spy.wait(), "Search progress didn't change");
146+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Search progress didn't change");
147 }
148 }
149 }
150
151=== modified file 'src/scope-harness/test-utils.cpp'
152--- src/scope-harness/test-utils.cpp 2016-03-07 08:29:14 +0000
153+++ src/scope-harness/test-utils.cpp 2016-09-08 08:53:48 +0000
154@@ -90,7 +90,7 @@
155 QVERIFY(scope->searchInProgress() || spy.count() > 1);
156 if (scope->searchInProgress()) {
157 // wait for the search to finish
158- QVERIFY(spy.wait());
159+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
160 }
161 QCOMPARE(scope->searchInProgress(), false);
162 }
163@@ -103,10 +103,10 @@
164 scope->setSearchQuery(searchString);
165 // search should not be happening yet
166 QCOMPARE(scope->searchInProgress(), false);
167- QVERIFY(spy.wait());
168+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
169 if (scope->searchInProgress()) {
170 // wait for the search to finish
171- QVERIFY(spy.wait());
172+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
173 }
174 QCOMPARE(scope->searchInProgress(), false);
175 }
176@@ -116,9 +116,9 @@
177 QCOMPARE(scope->searchInProgress(), false);
178 // wait for the search to finish
179 QSignalSpy spy(scope.data(), SIGNAL(searchInProgressChanged()));
180- QVERIFY(spy.wait());
181+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
182 if(spy.size() == 1) {
183- QVERIFY(spy.wait());
184+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
185 }
186 QCOMPARE(scope->searchInProgress(), false);
187 }
188@@ -127,10 +127,10 @@
189 {
190 QCOMPARE(scope->searchInProgress(), true);
191 QSignalSpy spy(scope.data(), SIGNAL(searchInProgressChanged()));
192- QVERIFY(spy.wait());
193+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
194 if (scope->searchInProgress()) {
195 // wait for the search to finish
196- QVERIFY(spy.wait());
197+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
198 }
199 QCOMPARE(scope->searchInProgress(), false);
200 }
201@@ -138,7 +138,7 @@
202 void TestUtils::waitForFilterStateChange(QSharedPointer<ss::ScopeInterface> scope)
203 {
204 QSignalSpy spy(scope->filters(), SIGNAL(filterStateChanged()));
205- QVERIFY(spy.wait());
206+ QVERIFY(spy.wait(SIG_SPY_TIMEOUT));
207 QCOMPARE(spy.count(), 1);
208 }
209
210
211=== modified file 'src/scope-harness/test-utils.h'
212--- src/scope-harness/test-utils.h 2016-03-07 08:29:14 +0000
213+++ src/scope-harness/test-utils.h 2016-09-08 08:53:48 +0000
214@@ -28,6 +28,8 @@
215 namespace unity {
216 namespace scopeharness {
217
218+static constexpr int SIG_SPY_TIMEOUT = 60000; // milliseconds
219+
220 class TestUtils
221 {
222 public:
223
224=== modified file 'src/scope-harness/view/preview-view.cpp'
225--- src/scope-harness/view/preview-view.cpp 2016-02-17 15:49:37 +0000
226+++ src/scope-harness/view/preview-view.cpp 2016-09-08 08:53:48 +0000
227@@ -63,7 +63,7 @@
228 if (!previewModel->loaded())
229 {
230 QSignalSpy spy(previewModel, SIGNAL(loadedChanged()));
231- spy.wait();
232+ spy.wait(SIG_SPY_TIMEOUT);
233 }
234
235 vector<preview::PreviewWidgetList> previewModels;
236
237=== modified file 'src/scope-harness/view/results-view.cpp'
238--- src/scope-harness/view/results-view.cpp 2016-04-21 10:00:57 +0000
239+++ src/scope-harness/view/results-view.cpp 2016-09-08 08:53:48 +0000
240@@ -123,7 +123,7 @@
241
242 if (!navigationModel->loaded())
243 {
244- TestUtils::throwIfNot(spy.wait(), "Department model failed to load");
245+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Department model failed to load");
246 }
247
248 return results::Department(internal::DepartmentArguments{navigationModel});
249@@ -180,11 +180,11 @@
250
251 if (!scope->searchInProgress())
252 {
253- spy.wait(100);
254+ spy.wait(2000);
255 }
256 if (scope->searchInProgress())
257 {
258- TestUtils::throwIfNot(spy.wait(), "Active scope didn't finish searching");
259+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Active scope didn't finish searching");
260 }
261
262 break;
263@@ -223,11 +223,11 @@
264 p->m_active_scope->setSearchQuery(searchString);
265 // search should not be happening yet
266 TestUtils::throwIf(p->m_active_scope->searchInProgress(), "Search was in progress too soon");
267- TestUtils::throwIfNot(spy.wait(), "Search spy received no events");
268+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Search spy received no events");
269 if (p->m_active_scope->searchInProgress())
270 {
271 // wait for the search to finish
272- TestUtils::throwIfNot(spy.wait(), "Search spy received no events");
273+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Search spy received no events");
274 }
275 TestUtils::throwIf(p->m_active_scope->searchInProgress(), "Search did not complete");
276 }
277@@ -246,7 +246,7 @@
278 if (p->m_active_scope->searchInProgress())
279 {
280 // wait for the search to finish
281- TestUtils::throwIfNot(spy.wait(), "Search spy received no events");
282+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Search spy received no events");
283 }
284 TestUtils::throwIf(p->m_active_scope->searchInProgress(), "Search did not complete");
285 }
286@@ -258,9 +258,9 @@
287 TestUtils::throwIf(p->m_active_scope->searchInProgress(), "Search is already in progress");
288 // wait for the search to finish
289 QSignalSpy spy(p->m_active_scope.data(), SIGNAL(searchInProgressChanged()));
290- TestUtils::throwIfNot(spy.wait(), "Search status didn't change");
291+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Search status didn't change");
292 if(spy.size() == 1) {
293- TestUtils::throwIfNot(spy.wait(), "Search status didn't change");
294+ TestUtils::throwIfNot(spy.wait(SIG_SPY_TIMEOUT), "Search status didn't change");
295 }
296 TestUtils::throwIf(p->m_active_scope->searchInProgress(), "");
297 }
298
299=== modified file 'src/scope-harness/view/settings-view.cpp'
300--- src/scope-harness/view/settings-view.cpp 2015-06-11 16:10:09 +0000
301+++ src/scope-harness/view/settings-view.cpp 2016-09-08 08:53:48 +0000
302@@ -155,7 +155,7 @@
303 }
304 QSignalSpy settingChangedSpy(settings, SIGNAL(settingsChanged()));
305 settings->setData(index, ng::scopeVariantToQVariant(val), ss::SettingsModelInterface::Roles::RoleValue);
306- TestUtils::throwIfNot(settingChangedSpy.wait(), "Settings update failed");
307+ TestUtils::throwIfNot(settingChangedSpy.wait(SIG_SPY_TIMEOUT), "Settings update failed");
308 TestUtils::waitForSearchFinish(p->m_scope);
309 return;
310 }

Subscribers

People subscribed via source and target branches

to all changes: