diff --git a/autotests/integration/shell_client_test.cpp b/autotests/integration/shell_client_test.cpp index a6ab4431fd..59d0202b9a 100644 --- a/autotests/integration/shell_client_test.cpp +++ b/autotests/integration/shell_client_test.cpp @@ -982,11 +982,15 @@ void TestShellClient::testUnresponsiveWindow() process->setProcessEnvironment(env); process->setProcessChannelMode(QProcess::ForwardedChannels); process->setProgram(kill); + QSignalSpy processStartedSpy{process.data(), &QProcess::started}; + QVERIFY(processStartedSpy.isValid()); process->start(); - QVERIFY(process->waitForStarted()); + QVERIFY(processStartedSpy.wait()); AbstractClient *killClient = nullptr; - QVERIFY(shellClientAddedSpy.wait()); + if (shellClientAddedSpy.isEmpty()) { + QVERIFY(shellClientAddedSpy.wait()); + } killClient = shellClientAddedSpy.first().first().value(); QSignalSpy unresponsiveSpy(killClient, &AbstractClient::unresponsiveChanged); QSignalSpy killedSpy(process.data(), static_cast(&QProcess::finished));