From a81043959a98fa90cb148e23a1ab61e756621b0c Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 28 Nov 2014 11:49:26 +0100 Subject: [PATCH] Test: wait for actual startup in start_server. start_server now uses return value from Tcl exec to get the server pid, however this introduces errors that depend from timing: a lot of the testing code base assumed the server to be actually up and running when server_start returns. So the old code that waits to see the pid in the log file was restored. --- tests/support/server.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/support/server.tcl b/tests/support/server.tcl index 8f8461bb..67ee2452 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -240,6 +240,12 @@ proc start_server {options {code undefined}} { return } + # Wait for actual startup + while {![info exists _pid]} { + regexp {PID:\s(\d+)} [exec cat $stdout] _ _pid + after 100 + } + # setup properties to be able to initialize a client object set host $::host set port $::port -- GitLab