summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authoryoav-steinberg <yoav@monfort.co.il>2021-11-15 11:07:43 +0200
committerGitHub <noreply@github.com>2021-11-15 11:07:43 +0200
commite968d9ac5846deac81e5f5288c23fef7a33d2dc2 (patch)
treea75973a2fea84cd53fbe09c990ce32b561c0c22d /tests/support
parent174eedce44946ba58426ad45fc206977a564d1d2 (diff)
downloadredis-e968d9ac5846deac81e5f5288c23fef7a33d2dc2.tar.gz
Connection leak in external tests. (#9777)
Two issues: 1. In many tests we simply forgot to close the connections we created, which doesn't matter for normal tests where the server is killed, but creates a leak on external server tests. 2. When calling `start_server` on external test we create a fresh connection instead of really starting a new server, but never clean it at the end.
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/server.tcl6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/support/server.tcl b/tests/support/server.tcl
index d91d60730..4c63d7b3a 100644
--- a/tests/support/server.tcl
+++ b/tests/support/server.tcl
@@ -378,7 +378,11 @@ proc run_external_server_test {code overrides} {
r config set $param $val
}
- lpop ::servers
+ set srv [lpop ::servers]
+
+ if {[dict exists $srv "client"]} {
+ [dict get $srv "client"] close
+ }
}
proc start_server {options {code undefined}} {