Cockatrice/servatrice/dev
BruebachL ccda73fe5c
[Server] Smoke-test the dev server end to end (#7865)
* [Server] Smoke-test the dev server end to end

Spawns servatrice-dev on an ephemeral port and drives a real RemoteClient through login, room list, room join and game creation, asserting each response and the Event_GameJoined payload. The test is WITH_SERVER-gated, links only the client remote library, and keeps the dev server's throwaway settings inside a temporary directory.

* [Server] Publish the dev server's port through a file

The smoke test parsed the listening port out of the dev server's stdout,
but the server announces it from the main thread while the logger thread
writes to the same stream. A log line can land inside the announcement —
Arch CI caught it — leaving the digits on the next line, so the test read
nothing and failed.

Add --port-file, written through QSaveFile once the server listens, and
read the port from there instead of from the log. The file is either
absent or complete, so logging cannot corrupt the handshake.

* [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.
2026-11-10 12:16:36 +01:00
..
main.cpp [Server] Smoke-test the dev server end to end (#7865) 2026-11-10 12:16:36 +01:00