From da36fd1c02555c7b952c31d4c34f870925f7d436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 4 Jul 2016 08:12:42 +0200 Subject: [PATCH] [autotests/integration] Try to make SceneQPainterTest::testWindow more robust It was failing on the CI system due to timing. Reorder the signalspy creation a little bit in the hope that this makes it pass. --- autotests/integration/scene_qpainter_test.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp index 6a5c55cc12..dbfd4286bc 100644 --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -143,14 +143,17 @@ void SceneQPainterTest::testWindow() QScopedPointer ss(Test::createShellSurface(s.data())); QScopedPointer p(Test::waylandSeat()->createPointer()); - // now let's map the window - QVERIFY(Test::renderAndWaitForShown(s.data(), QSize(200, 300), Qt::blue)); - // which should trigger a frame auto scene = qobject_cast(KWin::Compositor::self()->scene()); QVERIFY(scene); QSignalSpy frameRenderedSpy(scene, &Scene::frameRendered); QVERIFY(frameRenderedSpy.isValid()); - QVERIFY(frameRenderedSpy.wait()); + + // now let's map the window + QVERIFY(Test::renderAndWaitForShown(s.data(), QSize(200, 300), Qt::blue)); + // which should trigger a frame + if (frameRenderedSpy.isEmpty()) { + QVERIFY(frameRenderedSpy.wait()); + } // we didn't set a cursor image on the surface yet, so it should be just black + window QImage referenceImage(QSize(1280, 1024), QImage::Format_RGB32); referenceImage.fill(Qt::black);