From e8aa5583d0687bd1e07d6b8eebd358c6410df135 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Tue, 21 Jul 2020 16:56:19 +0300 Subject: [PATCH] testsuite may leave servers alive on error (#7549) in cases where you have test name { start_server { start_server { assert } } } the exception will be thrown to the test proc, and the servers are supposed to be killed on the way out. but it seems there was always a bug of not cleaning the server stack, and recently (#7404) we started relying on that stack in order to kill them, so with that bug sometimes we would have tried to kill the same server twice, and leave one alive. luckly, in most cases the pattern is: start_server { test name { } } (cherry picked from commit 36b949438547eb5bf8555fcac2c5040528fd7854) --- tests/support/server.tcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/support/server.tcl b/tests/support/server.tcl index ea7d0b13c..0afe89f7c 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -396,6 +396,9 @@ proc start_server {options {code undefined}} { # fetch srv back from the server list, in case it was restarted by restart_server (new PID) set srv [lindex $::servers end] + # pop the server object + set ::servers [lrange $::servers 0 end-1] + # Kill the server without checking for leaks dict set srv "skipleaks" 1 kill_server $srv