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.
This commit is contained in:
Yossi Gottlieb 2020-09-07 17:30:36 +03:00 committed by GitHub
parent 42ba7a1b75
commit 2df4cb93ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}