summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2020-07-10 08:26:52 +0300
committerGitHub <noreply@github.com>2020-07-10 08:26:52 +0300
commit69ade87325eedebdb44760af9a8c28e15381888e (patch)
tree441c2aab0c3dc90e8ee006dddb6d092e7615d95a /tests/integration
parent9bbf768d3ceaa882c7dcc0033fc3cb4be0973248 (diff)
downloadredis-69ade87325eedebdb44760af9a8c28e15381888e.tar.gz
tests/valgrind: don't use debug restart (#7404)
* tests/valgrind: don't use debug restart DEBUG REATART causes two issues: 1. it uses execve which replaces the original process and valgrind doesn't have a chance to check for errors, so leaks go unreported. 2. valgrind report invalid calls to close() which we're unable to resolve. So now the tests use restart_server mechanism in the tests, that terminates the old server and starts a new one, new PID, but same stdout, stderr. since the stderr can contain two or more valgrind report, it is not enough to just check for the absence of leaks, we also need to check for some known errors, we do both, and fail if we either find an error, or can't find a report saying there are no leaks. other changes: - when killing a server that was already terminated we check for leaks too. - adding DEBUG LEAK which was used to test it. - adding --trace-children to valgrind, although no longer needed. - since the stdout contains two or more runs, we need slightly different way of checking if the new process is up (explicitly looking for the new PID) - move the code that handles --wait-server to happen earlier (before watching the startup message in the log), and serve the restarted server too. * squashme - CR fixes
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/psync2.tcl6
-rw-r--r--tests/integration/rdb.tcl14
2 files changed, 6 insertions, 14 deletions
diff --git a/tests/integration/psync2.tcl b/tests/integration/psync2.tcl
index 3f636463a..1b996ffd4 100644
--- a/tests/integration/psync2.tcl
+++ b/tests/integration/psync2.tcl
@@ -280,7 +280,8 @@ start_server {} {
set sync_partial_err [status $R($master_id) sync_partial_err]
catch {
$R($slave_id) config rewrite
- $R($slave_id) debug restart
+ restart_server [expr {0-$slave_id}] true
+ set R($slave_id) [srv [expr {0-$slave_id}] client]
}
# note: just waiting for connected_slaves==4 has a race condition since
# we might do the check before the master realized that the slave disconnected
@@ -328,7 +329,8 @@ start_server {} {
catch {
$R($slave_id) config rewrite
- $R($slave_id) debug restart
+ restart_server [expr {0-$slave_id}] true
+ set R($slave_id) [srv [expr {0-$slave_id}] client]
}
# Reconfigure the slave correctly again, when it's back online.
diff --git a/tests/integration/rdb.tcl b/tests/integration/rdb.tcl
index 123e9c8b6..b176bf199 100644
--- a/tests/integration/rdb.tcl
+++ b/tests/integration/rdb.tcl
@@ -137,18 +137,8 @@ test {client freed during loading} {
# 100mb of rdb, 100k keys will load in more than 1 second
r debug populate 100000 key 1000
- catch {
- r debug restart
- }
+ restart_server 0 false
- set stdout [srv 0 stdout]
- while 1 {
- # check that the new server actually started and is ready for connections
- if {[exec grep -i "Server initialized" | wc -l < $stdout] > 1} {
- break
- }
- after 10
- }
# make sure it's still loading
assert_equal [s loading] 1
@@ -180,4 +170,4 @@ test {client freed during loading} {
# no need to keep waiting for loading to complete
exec kill [srv 0 pid]
}
-} \ No newline at end of file
+}