From 2df4cb93acabf10bb0ff39c12030791b0947e719 Mon Sep 17 00:00:00 2001 From: Yossi Gottlieb Date: Mon, 7 Sep 2020 17:30:36 +0300 Subject: [PATCH] Tests: fix unmonitored servers. (#7756) There is an inherent race condition in port allocation for spawned servers. If a server fails to start because a port is taken, a new port is allocated. This fixes a problem where the logs are not truncated and as a result a large number of unmonitored servers are started. --- tests/support/server.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/support/server.tcl b/tests/support/server.tcl index f74d839ad..30d0d4045 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -383,6 +383,11 @@ proc start_server {options {code undefined}} { dict set config port $port } create_server_config_file $config_file $config + + # Truncate log so wait_server_started will not be looking at + # output of the failed server. + close [open $stdout "w"] + continue; # Try again }