@@ -160,10 +160,13 @@ private Q_SLOTS:
160160 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
161161 greeter->authenticate("no-password");
162162
163− // once for locked, once for user; first will be locked mode
164− while (spy.count() != 2) {
163+ // Two property changed signals will be emitted, one for the IsLocked
164+ // property, one for the ActiveEntry; the first will be IsLocked.
165+ spy.wait();
166+ if (spy.count() < 2) {
165167 spy.wait();
166168 }
169+ QCOMPARE(spy.count(), 2);
167170
168171 QList<QVariant> arguments = spy.takeFirst();
169172 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");