[Tests] Tick the event loop while waiting for the port file

The port-file wait loop slept with QThread::msleep and never reached the
event dispatcher. QProcess fills its read buffers and flips its state only
from its socket notifiers, so drainProcessOutput() was a no-op and a child
that died before publishing its port went unnoticed until the full 15 s
startup timeout, with empty stdout and stderr in the failure message.

Pump the event loop instead, as the previous waitForReadyRead loop did.
This commit is contained in:
Lukas Brübach 2026-11-10 12:07:46 +01:00
parent 5f6b8b02a5
commit d9bbec000c

View file

@ -154,7 +154,10 @@ protected:
drainProcessOutput(); drainProcessOutput();
return false; return false;
} }
QThread::msleep(20); // An event tick, not a bare sleep: QProcess fills its read buffers and flips its state
// only from its socket notifiers, so without this the drain below is a no-op and a dead
// child is not noticed until the full timeout has elapsed.
QCoreApplication::processEvents(QEventLoop::AllEvents, 20);
} }
drainProcessOutput(); drainProcessOutput();
return false; return false;