Merge lp:~boiko/telephony-service/fix_flaky_tests into lp:telephony-service

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 1061
Merged at revision: 1055
Proposed branch: lp:~boiko/telephony-service/fix_flaky_tests
Merge into: lp:telephony-service
Diff against target: 189 lines (+28/-23)
5 files modified
cmake/modules/GenerateTest.cmake (+1/-0)
libtelephonyservice/accountentry.cpp (+8/-8)
tests/libtelephonyservice/AccountEntryTest.cpp (+7/-5)
tests/libtelephonyservice/OfonoAccountEntryTest.cpp (+7/-8)
tests/libtelephonyservice/TelepathyHelperTest.cpp (+5/-2)
To merge this branch: bzr merge lp:~boiko/telephony-service/fix_flaky_tests
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+256377@code.launchpad.net

Commit message

Another attempt to fix the failures that happen only on PPA/jenkins.

Description of the change

Another attempt to fix the failures that happen only on PPA/jenkins.

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1056. By Gustavo Pichorim Boiko

One more try.

1057. By Gustavo Pichorim Boiko

Fix two more points of possible problems.

1058. By Gustavo Pichorim Boiko

Just in case, wait on some more comparisons

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: Approve (continuous-integration)
1059. By Gustavo Pichorim Boiko

And yet another attempt.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1060. By Gustavo Pichorim Boiko

Add dbus-monitor just to understand what is going on.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1061. By Gustavo Pichorim Boiko

Improve some signal emissions.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
No, not related to the changes.

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cmake/modules/GenerateTest.cmake'
--- cmake/modules/GenerateTest.cmake 2015-03-30 20:54:48 +0000
+++ cmake/modules/GenerateTest.cmake 2015-04-16 16:46:31 +0000
@@ -113,6 +113,7 @@
113 --task dconf -p write -p /org/gnome/empathy/use-conn -p false --task-name dconf-write --wait-for ca.desrt.dconf --ignore-return113 --task dconf -p write -p /org/gnome/empathy/use-conn -p false --task-name dconf-write --wait-for ca.desrt.dconf --ignore-return
114 --task /usr/lib/telepathy/mission-control-5 --task-name mission-control --wait-for ca.desrt.dconf --ignore-return114 --task /usr/lib/telepathy/mission-control-5 --task-name mission-control --wait-for ca.desrt.dconf --ignore-return
115 --task ${CMAKE_BINARY_DIR}/tests/common/mock/telepathy-mock --task-name telepathy-mock --wait-for org.freedesktop.Telepathy.MissionControl5 --ignore-return115 --task ${CMAKE_BINARY_DIR}/tests/common/mock/telepathy-mock --task-name telepathy-mock --wait-for org.freedesktop.Telepathy.MissionControl5 --ignore-return
116 --task dbus-monitor --task-name dbus-monitor --ignore-return
116 # FIXME: maybe it would be better to decide whether to run the handler in a per-test basis?117 # FIXME: maybe it would be better to decide whether to run the handler in a per-test basis?
117 --task ${CMAKE_BINARY_DIR}/handler/telephony-service-handler --task-name telephony-service-handler --wait-for org.freedesktop.Telepathy.ConnectionManager.mock --ignore-return118 --task ${CMAKE_BINARY_DIR}/handler/telephony-service-handler --task-name telephony-service-handler --wait-for org.freedesktop.Telepathy.ConnectionManager.mock --ignore-return
118 ${ARG_TASKS})119 ${ARG_TASKS})
119120
=== modified file 'libtelephonyservice/accountentry.cpp'
--- libtelephonyservice/accountentry.cpp 2015-03-17 18:26:32 +0000
+++ libtelephonyservice/accountentry.cpp 2015-04-16 16:46:31 +0000
@@ -149,6 +149,14 @@
149 SIGNAL(connectedChanged()),149 SIGNAL(connectedChanged()),
150 SIGNAL(activeChanged()));150 SIGNAL(activeChanged()));
151151
152 // emit the statusChanged and statusMessageChanged signals together with the connectedChanged to be consistent
153 connect(this,
154 SIGNAL(connectedChanged()),
155 SIGNAL(statusChanged()));
156 connect(this,
157 SIGNAL(connectedChanged()),
158 SIGNAL(statusMessageChanged()));
159
152 // and make sure it is enabled and connected160 // and make sure it is enabled and connected
153 if (!mAccount->isEnabled()) {161 if (!mAccount->isEnabled()) {
154 QTimer::singleShot(0, this, SLOT(ensureEnabled()));162 QTimer::singleShot(0, this, SLOT(ensureEnabled()));
@@ -188,12 +196,6 @@
188 connect(mAccount->connection()->selfContact().data(),196 connect(mAccount->connection()->selfContact().data(),
189 SIGNAL(presenceChanged(Tp::Presence)),197 SIGNAL(presenceChanged(Tp::Presence)),
190 SIGNAL(connectedChanged()));198 SIGNAL(connectedChanged()));
191 connect(mAccount->connection()->selfContact().data(),
192 SIGNAL(presenceChanged(Tp::Presence)),
193 SIGNAL(statusMessageChanged()));
194 connect(mAccount->connection()->selfContact().data(),
195 SIGNAL(presenceChanged(Tp::Presence)),
196 SIGNAL(statusChanged()));
197}199}
198200
199void AccountEntry::onSelfHandleChanged(uint handle)201void AccountEntry::onSelfHandleChanged(uint handle)
@@ -201,8 +203,6 @@
201 Q_UNUSED(handle)203 Q_UNUSED(handle)
202 watchSelfContactPresence();204 watchSelfContactPresence();
203205
204 Q_EMIT statusChanged();
205 Q_EMIT statusMessageChanged();
206 Q_EMIT connectedChanged();206 Q_EMIT connectedChanged();
207 Q_EMIT selfContactIdChanged();207 Q_EMIT selfContactIdChanged();
208}208}
209209
=== modified file 'tests/libtelephonyservice/AccountEntryTest.cpp'
--- tests/libtelephonyservice/AccountEntryTest.cpp 2015-03-27 02:47:52 +0000
+++ tests/libtelephonyservice/AccountEntryTest.cpp 2015-04-16 16:46:31 +0000
@@ -75,7 +75,7 @@
75 mMockController = new MockController("mock", this);75 mMockController = new MockController("mock", this);
7676
77 // just in case, wait some time77 // just in case, wait some time
78 QTest::qWait(500);78 QTest::qWait(1000);
79}79}
8080
81void AccountEntryTest::cleanup()81void AccountEntryTest::cleanup()
@@ -151,7 +151,7 @@
151 mTpAccount->setRequestedPresence(presence);151 mTpAccount->setRequestedPresence(presence);
152152
153 QTRY_COMPARE(mAccount->status(), QString("away"));153 QTRY_COMPARE(mAccount->status(), QString("away"));
154 QCOMPARE(statusChangedSpy.count(), 1);154 QTRY_COMPARE(statusChangedSpy.count(), 1);
155155
156 // check that for a null account the status is null156 // check that for a null account the status is null
157 QVERIFY(mNullAccount->status().isNull());157 QVERIFY(mNullAccount->status().isNull());
@@ -166,11 +166,10 @@
166166
167 // and now set a new value167 // and now set a new value
168 QString statusMessage("I am online");168 QString statusMessage("I am online");
169 Tp::Presence presence(Tp::ConnectionPresenceTypeAvailable, "available", statusMessage);169 mMockController->setPresence("available", statusMessage);
170 mTpAccount->setRequestedPresence(presence);
171170
172 QTRY_COMPARE(mAccount->statusMessage(), statusMessage);171 QTRY_COMPARE(mAccount->statusMessage(), statusMessage);
173 QCOMPARE(statusMessageChangedSpy.count(), 1);172 QTRY_COMPARE(statusMessageChangedSpy.count(), 1);
174173
175 // check that for a null account the displayName is null174 // check that for a null account the displayName is null
176 QVERIFY(mNullAccount->statusMessage().isNull());175 QVERIFY(mNullAccount->statusMessage().isNull());
@@ -188,6 +187,9 @@
188 QTRY_VERIFY(!mAccount->connected());187 QTRY_VERIFY(!mAccount->connected());
189 QTRY_COMPARE(connectedChangedSpy.count(), 1);188 QTRY_COMPARE(connectedChangedSpy.count(), 1);
190189
190 // it shouldn't be necessary, but in any case
191 QTest::qWait(500);
192
191 // now re-enable the account and check that the entry is updated193 // now re-enable the account and check that the entry is updated
192 connectedChangedSpy.clear();194 connectedChangedSpy.clear();
193 mMockController->setOnline(true);195 mMockController->setOnline(true);
194196
=== modified file 'tests/libtelephonyservice/OfonoAccountEntryTest.cpp'
--- tests/libtelephonyservice/OfonoAccountEntryTest.cpp 2015-03-30 20:54:48 +0000
+++ tests/libtelephonyservice/OfonoAccountEntryTest.cpp 2015-04-16 16:46:31 +0000
@@ -75,7 +75,7 @@
75 mMockController = new MockController("ofono", this);75 mMockController = new MockController("ofono", this);
7676
77 // just in case, wait some time77 // just in case, wait some time
78 QTest::qWait(500);78 QTest::qWait(1000);
79}79}
8080
81void OfonoAccountEntryTest::cleanup()81void OfonoAccountEntryTest::cleanup()
@@ -102,13 +102,13 @@
102 // now set the account offline and see if the active flag changes correctly102 // now set the account offline and see if the active flag changes correctly
103 mMockController->setOnline(false);103 mMockController->setOnline(false);
104 QTRY_VERIFY(!mAccount->connected());104 QTRY_VERIFY(!mAccount->connected());
105 QCOMPARE(connectedChangedSpy.count(), 1);105 QTRY_COMPARE(connectedChangedSpy.count(), 1);
106106
107 // now re-enable the account and check that the entry is updated107 // now re-enable the account and check that the entry is updated
108 connectedChangedSpy.clear();108 connectedChangedSpy.clear();
109 mMockController->setOnline(true);109 mMockController->setOnline(true);
110 QTRY_VERIFY(mAccount->connected());110 QTRY_VERIFY(mAccount->connected());
111 QCOMPARE(connectedChangedSpy.count(), 1);111 QTRY_COMPARE(connectedChangedSpy.count(), 1);
112}112}
113113
114void OfonoAccountEntryTest::testCompareIds_data()114void OfonoAccountEntryTest::testCompareIds_data()
@@ -165,13 +165,13 @@
165 // set to true165 // set to true
166 mMockController->setVoicemailIndicator(true);166 mMockController->setVoicemailIndicator(true);
167 QTRY_COMPARE(voiceMailIndicatorSpy.count(), 1);167 QTRY_COMPARE(voiceMailIndicatorSpy.count(), 1);
168 QVERIFY(mAccount->voicemailIndicator());168 QTRY_VERIFY(mAccount->voicemailIndicator());
169169
170 // and set back to false170 // and set back to false
171 voiceMailIndicatorSpy.clear();171 voiceMailIndicatorSpy.clear();
172 mMockController->setVoicemailIndicator(false);172 mMockController->setVoicemailIndicator(false);
173 QTRY_COMPARE(voiceMailIndicatorSpy.count(), 1);173 QTRY_COMPARE(voiceMailIndicatorSpy.count(), 1);
174 QVERIFY(!mAccount->voicemailIndicator());174 QTRY_VERIFY(!mAccount->voicemailIndicator());
175}175}
176176
177void OfonoAccountEntryTest::testVoicemailNumber()177void OfonoAccountEntryTest::testVoicemailNumber()
@@ -256,11 +256,10 @@
256256
257 // set the value257 // set the value
258 QString statusMessage("SomeNetwork");258 QString statusMessage("SomeNetwork");
259 Tp::Presence presence(Tp::ConnectionPresenceTypeAvailable, "available", statusMessage);259 mMockController->setPresence("available", statusMessage);
260 mTpAccount->setRequestedPresence(presence);
261260
262 QTRY_COMPARE(mAccount->networkName(), statusMessage);261 QTRY_COMPARE(mAccount->networkName(), statusMessage);
263 QCOMPARE(networkNameChangedSpy.count(), 1);262 QTRY_COMPARE(networkNameChangedSpy.count(), 1);
264}263}
265264
266void OfonoAccountEntryTest::testAddressableVCardFields()265void OfonoAccountEntryTest::testAddressableVCardFields()
267266
=== modified file 'tests/libtelephonyservice/TelepathyHelperTest.cpp'
--- tests/libtelephonyservice/TelepathyHelperTest.cpp 2015-03-30 18:48:38 +0000
+++ tests/libtelephonyservice/TelepathyHelperTest.cpp 2015-04-16 16:46:31 +0000
@@ -68,6 +68,9 @@
68 // and create the mock controller68 // and create the mock controller
69 mGenericController = new MockController("mock", this);69 mGenericController = new MockController("mock", this);
70 mPhoneController = new MockController("ofono", this);70 mPhoneController = new MockController("ofono", this);
71
72 // just in case, wait some time
73 QTest::qWait(1000);
71}74}
7275
73void TelepathyHelperTest::cleanup()76void TelepathyHelperTest::cleanup()
@@ -214,7 +217,7 @@
214 // now set one of the accounts as offline and make sure it is captured217 // now set one of the accounts as offline and make sure it is captured
215 mGenericController->setOnline(false);218 mGenericController->setOnline(false);
216 QTRY_COMPARE_WITH_TIMEOUT(activeAccountsSpy.count(), 1, DEFAULT_TIMEOUT);219 QTRY_COMPARE_WITH_TIMEOUT(activeAccountsSpy.count(), 1, DEFAULT_TIMEOUT);
217 QCOMPARE(TelepathyHelper::instance()->activeAccounts().count(), 1);220 QTRY_COMPARE(TelepathyHelper::instance()->activeAccounts().count(), 1);
218 QCOMPARE(TelepathyHelper::instance()->activeAccounts()[0]->accountId(), mPhoneTpAccount->uniqueIdentifier());221 QCOMPARE(TelepathyHelper::instance()->activeAccounts()[0]->accountId(), mPhoneTpAccount->uniqueIdentifier());
219222
220 // set the other account offline to make sure223 // set the other account offline to make sure
@@ -228,7 +231,7 @@
228 mGenericController->setOnline(true);231 mGenericController->setOnline(true);
229 mPhoneController->setOnline(true);232 mPhoneController->setOnline(true);
230 QTRY_COMPARE_WITH_TIMEOUT(activeAccountsSpy.count(), 2, DEFAULT_TIMEOUT);233 QTRY_COMPARE_WITH_TIMEOUT(activeAccountsSpy.count(), 2, DEFAULT_TIMEOUT);
231 QCOMPARE(TelepathyHelper::instance()->activeAccounts().count(), 2);234 QTRY_COMPARE(TelepathyHelper::instance()->activeAccounts().count(), 2);
232}235}
233236
234void TelepathyHelperTest::testAccountForId()237void TelepathyHelperTest::testAccountForId()

Subscribers

People subscribed via source and target branches