From 6dd0e177591be4a80ce45f712c7592eceee25259 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Sat, 2 Mar 2019 15:06:12 +0000 Subject: [PATCH] Hopefully fix flaky remote access test Summary: We have 4 events: buffer1 created buffer2 created buffer1 paramters sent buffer2 paramters sent Some are batched We should connect to buffer 1's parameters being sent after the first buffer is recieved, not in the potential event loop waiting for buffer 2. Test Plan: Passes locally Haven't tested on build.k.o Reviewers: #kwin Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D19476 --- src/wayland/autotests/client/test_remote_access.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/wayland/autotests/client/test_remote_access.cpp b/src/wayland/autotests/client/test_remote_access.cpp index 8eb0d30a77..d209843b4d 100644 --- a/src/wayland/autotests/client/test_remote_access.cpp +++ b/src/wayland/autotests/client/test_remote_access.cpp @@ -273,16 +273,15 @@ void RemoteAccessTest::testSendReleaseMultiple() // wait for event loop QVERIFY(bufferReadySpy1.wait()); - if (bufferReadySpy2.size() == 0) { - QVERIFY(bufferReadySpy2.wait()); - } - // receive buffer at client 1 QCOMPARE(bufferReadySpy1.size(), 1); auto rbuf1 = bufferReadySpy1.takeFirst()[1].value(); QSignalSpy paramsObtainedSpy1(rbuf1, &RemoteBuffer::parametersObtained); QVERIFY(paramsObtainedSpy1.isValid()); + if (bufferReadySpy2.size() == 0) { + QVERIFY(bufferReadySpy2.wait()); + } // receive buffer at client 2 QCOMPARE(bufferReadySpy2.size(), 1); auto rbuf2 = bufferReadySpy2.takeFirst()[1].value(); @@ -290,7 +289,7 @@ void RemoteAccessTest::testSendReleaseMultiple() QVERIFY(paramsObtainedSpy2.isValid()); // wait for event loop - QVERIFY(paramsObtainedSpy1.wait()); + QVERIFY(paramsObtainedSpy1.size() == 1 || paramsObtainedSpy1.wait()); QCOMPARE(paramsObtainedSpy1.size(), 1); if (paramsObtainedSpy2.size() == 0) { QVERIFY(paramsObtainedSpy2.wait());