Commit 7809e830 authored by Roman Gilg's avatar Roman Gilg
Browse files

Reduce unnecessary long wait times on failing signal spies

Summary:
Several signal spies, which were supposed to fail, were waiting for the
default 5 seconds, which is most often unnecessary long.

This patch sets a time limit of 500ms in suitable cases. Reduces for me
the total test time by 40%.

Test Plan:
Before (with fixed seat and selection tests):
98% tests passed, 1 tests failed out of 45

Total Test time (real) = 173.31 sec

The following tests FAILED:
         19 - kwayland-testWindowmanagement (Failed)

After:
98% tests passed, 1 tests failed out of 45

Total Test time (real) = 102.12 sec

The following tests FAILED:
         19 - kwayland-testWindowmanagement (Failed)

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D14184
parent d544837e
......@@ -204,7 +204,7 @@ KWayland::Server::SurfaceInterface *TestDragAndDrop::getServerSurface()
if (!surfaceCreatedSpy.isValid()) {
return nullptr;
}
if (!surfaceCreatedSpy.wait()) {
if (!surfaceCreatedSpy.wait(500)) {
return nullptr;
}
return surfaceCreatedSpy.first().first().value<SurfaceInterface*>();
......@@ -389,7 +389,7 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
QVERIFY(droppedSpy.isValid());
m_seatInterface->setTimestamp(4);
m_seatInterface->pointerButtonReleased(1);
QVERIFY(!droppedSpy.wait());
QVERIFY(!droppedSpy.wait(500));
// verify that we did not get any further input events
QVERIFY(pointerMotionSpy.isEmpty());
......
......@@ -213,7 +213,7 @@ void TestPointerConstraints::testLockPointer()
QCOMPARE(serverLockedPointer->lifeTime(), serverLifeTime);
// setting to unlocked now should not trigger an unlocked spy
serverLockedPointer->setLocked(false);
QVERIFY(!unlockedSpy.wait());
QVERIFY(!unlockedSpy.wait(500));
// try setting a region
QSignalSpy destroyedSpy(serverLockedPointer.data(), &QObject::destroyed);
......@@ -222,7 +222,7 @@ void TestPointerConstraints::testLockPointer()
QVERIFY(regionChangedSpy.isValid());
lockedPointer->setRegion(m_compositor->createRegion(QRegion(0, 5, 10, 20), m_compositor));
// it's double buffered
QVERIFY(!regionChangedSpy.wait());
QVERIFY(!regionChangedSpy.wait(500));
surface->commit(Surface::CommitFlag::None);
QVERIFY(regionChangedSpy.wait());
QCOMPARE(serverLockedPointer->region(), QRegion(0, 5, 10, 20));
......@@ -318,7 +318,7 @@ void TestPointerConstraints::testConfinePointer()
QCOMPARE(serverConfinedPointer->lifeTime(), serverLifeTime);
// setting to unconfined now should not trigger an unconfined spy
serverConfinedPointer->setConfined(false);
QVERIFY(!unconfinedSpy.wait());
QVERIFY(!unconfinedSpy.wait(500));
// try setting a region
QSignalSpy destroyedSpy(serverConfinedPointer.data(), &QObject::destroyed);
......@@ -327,7 +327,7 @@ void TestPointerConstraints::testConfinePointer()
QVERIFY(regionChangedSpy.isValid());
confinedPointer->setRegion(m_compositor->createRegion(QRegion(0, 5, 10, 20), m_compositor));
// it's double buffered
QVERIFY(!regionChangedSpy.wait());
QVERIFY(!regionChangedSpy.wait(500));
surface->commit(Surface::CommitFlag::None);
QVERIFY(regionChangedSpy.wait());
QCOMPARE(serverConfinedPointer->region(), QRegion(0, 5, 10, 20));
......
......@@ -108,7 +108,7 @@ bool SelectionTest::setupConnection(Connection* c)
c->thread->start();
c->connection->initConnection();
if (!connectedSpy.wait()) {
if (!connectedSpy.wait(500)) {
return false;
}
......@@ -126,7 +126,7 @@ bool SelectionTest::setupConnection(Connection* c)
return false;
}
registry.setup();
if (!interfacesAnnouncedSpy.wait()) {
if (!interfacesAnnouncedSpy.wait(500)) {
return false;
}
......@@ -152,7 +152,7 @@ bool SelectionTest::setupConnection(Connection* c)
if (!keyboardSpy.isValid()) {
return false;
}
if (!keyboardSpy.wait()) {
if (!keyboardSpy.wait(500)) {
return false;
}
if (!c->seat->hasKeyboard()) {
......
......@@ -199,7 +199,7 @@ SurfaceInterface *TextInputTest::waitForSurface()
if (!surfaceCreatedSpy.isValid()) {
return nullptr;
}
if (!surfaceCreatedSpy.wait()) {
if (!surfaceCreatedSpy.wait(500)) {
return nullptr;
}
if (surfaceCreatedSpy.count() != 1) {
......
......@@ -542,7 +542,7 @@ void TestWaylandSeat::testPointer()
// now a relative motion should not be sent to the relative pointer
m_seatInterface->relativePointerMotion(QSizeF(1, 2), QSizeF(3, 4), quint64(-1));
QVERIFY(!relativeMotionSpy.wait());
QVERIFY(!relativeMotionSpy.wait(500));
// enter it again
m_seatInterface->setFocusedPointerSurface(serverSurface, QPoint(0, 0));
......@@ -975,7 +975,7 @@ void TestWaylandSeat::testPointerSwipeGesture()
// another start should not be possible
m_seatInterface->startPointerSwipeGesture(2);
QVERIFY(!startSpy.wait());
QVERIFY(!startSpy.wait(500));
// send in some updates
m_seatInterface->setTimestamp(timestamp++);
......@@ -1091,7 +1091,7 @@ void TestWaylandSeat::testPointerPinchGesture()
// another start should not be possible
m_seatInterface->startPointerPinchGesture(3);
QVERIFY(!startSpy.wait());
QVERIFY(!startSpy.wait(500));
// send in some updates
m_seatInterface->setTimestamp(timestamp++);
......
......@@ -1143,12 +1143,12 @@ void TestWaylandSurface::testInhibit()
// creating a second idle inhibition should not trigger the signal
QScopedPointer<IdleInhibitor> inhibitor2(m_idleInhibitManager->createInhibitor(s.data()));
QVERIFY(!inhibitsChangedSpy.wait());
QVERIFY(!inhibitsChangedSpy.wait(500));
QCOMPARE(serverSurface->inhibitsIdle(), true);
// and also deleting the first inhibitor should not yet change the inhibition
inhibitor1.reset();
QVERIFY(!inhibitsChangedSpy.wait());
QVERIFY(!inhibitsChangedSpy.wait(500));
QCOMPARE(serverSurface->inhibitsIdle(), true);
// but deleting also the second inhibitor should trigger
......
Supports Markdown
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