Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e637d432 authored by Martin Flöser's avatar Martin Flöser

Remove potential endless loop from XClipboardSyncTest

Summary:
We need to wait till the helper process created the datadevice. For this
we used a while loop. On build.kde.org the test gets stuck in this loop
and times out after 10 minutes.

This change introduces a dedicated signal and we just wait for it. So if
something fails we wait only 5 sec instead of endless. This should help
investigate why the test doesn't work on build.kde.org.

Test Plan: Test works locally

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16741
parent f4663072
......@@ -56,6 +56,8 @@ void XClipboardSyncTest::initTestCase()
QVERIFY(workspaceCreatedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
QSignalSpy clipboardSyncDevicedCreated{waylandServer(), &WaylandServer::xclipboardSyncDataDeviceCreated};
QVERIFY(clipboardSyncDevicedCreated.isValid());
QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit()));
kwinApp()->start();
......@@ -65,8 +67,8 @@ void XClipboardSyncTest::initTestCase()
QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024));
waylandServer()->initWorkspace();
// wait till the xclipboard sync data device is created
while (waylandServer()->xclipboardSyncDataDevice().isNull()) {
QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents);
if (clipboardSyncDevicedCreated.empty()) {
QVERIFY(clipboardSyncDevicedCreated.wait());
}
QVERIFY(!waylandServer()->xclipboardSyncDataDevice().isNull());
}
......
......@@ -246,6 +246,7 @@ bool WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags)
[this] (DataDeviceInterface *ddi) {
if (ddi->client() == m_xclipbaordSync.client && m_xclipbaordSync.client != nullptr) {
m_xclipbaordSync.ddi = QPointer<DataDeviceInterface>(ddi);
emit xclipboardSyncDataDeviceCreated();
connect(m_xclipbaordSync.ddi.data(), &DataDeviceInterface::selectionChanged, this,
[this] {
// testing whether the active client inherits Client
......
......@@ -210,6 +210,7 @@ Q_SIGNALS:
void terminatingInternalClientConnection();
void initialized();
void foreignTransientChanged(KWayland::Server::SurfaceInterface *child);
void xclipboardSyncDataDeviceCreated();
private:
void setupX11ClipboardSync();
......
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