mirror of
https://github.com/redis/redis.git
synced 2026-02-03 20:39:54 -05:00
fix test tag leakage that can result in skipping tests (#14572)
Some checks are pending
CI / test-ubuntu-latest (push) Waiting to run
CI / test-sanitizer-address (push) Waiting to run
CI / build-debian-old (push) Waiting to run
CI / build-macos-latest (push) Waiting to run
CI / build-32bit (push) Waiting to run
CI / build-libc-malloc (push) Waiting to run
CI / build-centos-jemalloc (push) Waiting to run
CI / build-old-chain-jemalloc (push) Waiting to run
Codecov / code-coverage (push) Waiting to run
External Server Tests / test-external-standalone (push) Waiting to run
External Server Tests / test-external-cluster (push) Waiting to run
External Server Tests / test-external-nodebug (push) Waiting to run
Spellcheck / Spellcheck (push) Waiting to run
Some checks are pending
CI / test-ubuntu-latest (push) Waiting to run
CI / test-sanitizer-address (push) Waiting to run
CI / build-debian-old (push) Waiting to run
CI / build-macos-latest (push) Waiting to run
CI / build-32bit (push) Waiting to run
CI / build-libc-malloc (push) Waiting to run
CI / build-centos-jemalloc (push) Waiting to run
CI / build-old-chain-jemalloc (push) Waiting to run
Codecov / code-coverage (push) Waiting to run
External Server Tests / test-external-standalone (push) Waiting to run
External Server Tests / test-external-cluster (push) Waiting to run
External Server Tests / test-external-nodebug (push) Waiting to run
Spellcheck / Spellcheck (push) Waiting to run
some error handling paths didn't remove the tags they added, but most importantly, if the start_server proc is given the "tags" argument more than once, on exit, it only removed the last one. this problem exists in start_cluster in list.tcl, and the result was that the "external:skip cluster modules" were not removed
This commit is contained in:
parent
8d542434bd
commit
82fbf213eb
1 changed files with 10 additions and 3 deletions
|
|
@ -286,7 +286,10 @@ proc tags {tags code} {
|
|||
set ::tags [lrange $::tags 0 end-[llength $tags]]
|
||||
return
|
||||
}
|
||||
uplevel 1 $code
|
||||
if {[catch {uplevel 1 $code} error]} {
|
||||
set ::tags [lrange $::tags 0 end-[llength $tags]]
|
||||
error $error $::errorInfo
|
||||
}
|
||||
set ::tags [lrange $::tags 0 end-[llength $tags]]
|
||||
}
|
||||
|
||||
|
|
@ -486,8 +489,8 @@ proc start_server {options {code undefined}} {
|
|||
"tags" {
|
||||
# If we 'tags' contain multiple tags, quoted and separated by spaces,
|
||||
# we want to get rid of the quotes in order to have a proper list
|
||||
set tags [string map { \" "" } $value]
|
||||
set ::tags [concat $::tags $tags]
|
||||
set _tags [string map { \" "" } $value]
|
||||
set tags [concat $tags $_tags]
|
||||
}
|
||||
"keep_persistence" {
|
||||
set keep_persistence $value
|
||||
|
|
@ -500,6 +503,7 @@ proc start_server {options {code undefined}} {
|
|||
}
|
||||
}
|
||||
}
|
||||
set ::tags [concat $::tags $tags]
|
||||
|
||||
# We skip unwanted tags
|
||||
if {![tags_acceptable $::tags err]} {
|
||||
|
|
@ -655,6 +659,7 @@ proc start_server {options {code undefined}} {
|
|||
set err {}
|
||||
append err [exec cat $stdout] "\n" [exec cat $stderr]
|
||||
start_server_error $config_file $err
|
||||
set ::tags [lrange $::tags 0 end-[llength $tags]]
|
||||
return
|
||||
}
|
||||
set server_started 1
|
||||
|
|
@ -684,6 +689,7 @@ proc start_server {options {code undefined}} {
|
|||
if {$code ne "undefined"} {
|
||||
set line [exec head -n1 $stdout]
|
||||
if {[string match {*already in use*} $line]} {
|
||||
set ::tags [lrange $::tags 0 end-[llength $tags]]
|
||||
error_and_quit $config_file $line
|
||||
}
|
||||
|
||||
|
|
@ -755,6 +761,7 @@ proc start_server {options {code undefined}} {
|
|||
send_data_packet $::test_server_fd err [join $details "\n"]
|
||||
} else {
|
||||
# Re-raise, let handler up the stack take care of this.
|
||||
set ::tags [lrange $::tags 0 end-[llength $tags]]
|
||||
error $error $backtrace
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue