@@ -163,10 +163,13 @@ private Q_SLOTS:
163163 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
164164 greeter->authenticate("no-password");
165165
166− // once for user, once for locked; second will be for locked mode
167− while (spy.count() != 2) {
166+ // Two property changed signals will be emitted, one for the IsLocked
167+ // property, one for the ActiveEntry; the first will be IsLocked.
168+ spy.wait();
169+ if (spy.count() < 2) {
168170 spy.wait();
169171 }
172+ QCOMPARE(spy.count(), 2);
170173
171174 QList<QVariant> arguments = spy.takeLast();
172175 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");