[autotests] Try making TestWaylandSurface::testDisconnect more robust

On build.kde.org the Surface is often already destroyed when returning
from waiting on client disconnected.

This change tries to handle the situation better: only if the signal
is not yet emitted, try to wait for it.
This commit is contained in:
Martin Gräßlin 2016-08-08 08:38:57 +02:00
parent a092de25b4
commit 233e388e02

View file

@ -945,7 +945,9 @@ void TestWaylandSurface::testDisconnect()
}
QVERIFY(clientDisconnectedSpy.wait());
QCOMPARE(clientDisconnectedSpy.count(), 1);
QCOMPARE(surfaceDestroyedSpy.count(), 0);
if (surfaceDestroyedSpy.isEmpty()) {
QVERIFY(surfaceDestroyedSpy.wait());
}
QTRY_COMPARE(surfaceDestroyedSpy.count(), 1);
s->destroy();