mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 20:13:24 -08:00
[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:
parent
5f6b8b02a5
commit
d9bbec000c
1 changed files with 4 additions and 1 deletions
|
|
@ -154,7 +154,10 @@ protected:
|
|||
drainProcessOutput();
|
||||
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();
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue