Commit f0152135 authored by David Edmundson's avatar David Edmundson
Browse files

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
parent d5bea1c4
......@@ -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<const RemoteBuffer *>();
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<const RemoteBuffer *>();
......@@ -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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment