From f5f14475b568aff2251afc531648f2af207a8ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Tue, 25 Jul 2017 21:16:23 +0200 Subject: [PATCH] [autotests] Try to make PlasmaWindowTest::testCreateDestroyX11PlasmaWindow more robust The test was racing on build.kde.org and failing due to that. We have a condition there where we wait for some parts being transmitted through X and some through Wayland. The test assumed X is faster and failed due to that. --- autotests/integration/plasmawindow_test.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index 80b57ea367..87d52278a1 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -146,12 +146,13 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow() QVERIFY(client->isDecorated()); QVERIFY(client->isActive()); // verify that it gets the keyboard focus - QVERIFY(!client->surface()); - // we don't have a surface yet, so focused keyboard surface if set is not ours - QVERIFY(!waylandServer()->seat()->focusedKeyboardSurface()); - QSignalSpy surfaceChangedSpy(client, &Toplevel::surfaceChanged); - QVERIFY(surfaceChangedSpy.isValid()); - QVERIFY(surfaceChangedSpy.wait()); + if (!client->surface()) { + // we don't have a surface yet, so focused keyboard surface if set is not ours + QVERIFY(!waylandServer()->seat()->focusedKeyboardSurface()); + QSignalSpy surfaceChangedSpy(client, &Toplevel::surfaceChanged); + QVERIFY(surfaceChangedSpy.isValid()); + QVERIFY(surfaceChangedSpy.wait()); + } QVERIFY(client->surface()); QCOMPARE(waylandServer()->seat()->focusedKeyboardSurface(), client->surface());