From 233e388e02ca2af408d5139d0bb14119eac8f932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 8 Aug 2016 08:38:57 +0200 Subject: [PATCH] [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. --- src/wayland/autotests/client/test_wayland_surface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wayland/autotests/client/test_wayland_surface.cpp b/src/wayland/autotests/client/test_wayland_surface.cpp index 669288274d..123e660dcc 100644 --- a/src/wayland/autotests/client/test_wayland_surface.cpp +++ b/src/wayland/autotests/client/test_wayland_surface.cpp @@ -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();