[autotests] Fix quick tile autotest race condition

We send two async actions via another process
We do a wait for one
We check that we received two events

This is racey. QTRY_COMPARE can allow both events to arrive separately.
This commit is contained in:
David Edmundson 2020-06-19 00:06:04 +01:00 committed by David Edmundson
parent 4a681e3d47
commit 494b67d610

View file

@ -775,8 +775,7 @@ void QuickTilingTest::testShortcut()
QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid()); QVERIFY(quickTileChangedSpy.isValid());
QVERIFY(quickTileChangedSpy.wait()); QTRY_COMPARE(quickTileChangedSpy.count(), numberOfQuickTileActions);
QCOMPARE(quickTileChangedSpy.count(), numberOfQuickTileActions);
// at this point the geometry did not yet change // at this point the geometry did not yet change
QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50));
// but quick tile mode already changed // but quick tile mode already changed