From e78c4e813cecfa97505efe29c073f8088542f69e Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 21 Feb 2020 18:55:56 +0100 Subject: [PATCH] Test engine: detect timeout when checking for Redis startup. --- tests/support/server.tcl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/support/server.tcl b/tests/support/server.tcl index 174b05852..eec43e485 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -271,9 +271,19 @@ proc start_server {options {code undefined}} { } # Wait for actual startup + set checkperiod 100; # Milliseconds + set maxiter [expr {120*1000/100}] ; # Wait up to 2 minutes. while {![info exists _pid]} { regexp {PID:\s(\d+)} [exec cat $stdout] _ _pid - after 100 + after $checkperiod + incr maxiter -1 + if {$maxiter == 0} { + start_server_error $config_file "No PID detected in log $stdout" + puts "--- LOG CONTENT ---" + puts [exec cat $stdout] + puts "-------------------" + break + } } # setup properties to be able to initialize a client object