Fix CONFIG SET test failures in MacOS/FreeBSD (#9881)
After the introduction of `Multiparam config set` in #9748, there are two tests cases failed. ``` [exception]: Executing test client: ERR Config set failed - Failed to set current oom_score_adj. Check server logs.. ERR Config set failed - Failed to set current oom_score_adj. Check server logs. ``` `CONFIG sanity` test failed on the `config set oom-score-adj-values` which is a "special" config that does not catch no-op changes. And then it will update `oom-score-adj` which not supported in MacOs. We solve it by adding `oom-score*` to the `skip_configs` list. ``` *** [err]: CONFIG SET rollback on apply error in tests/unit/introspection.tcl Expected an error but nothing was caught ``` `CONFIG SET rollback on apply error` test failed on the `config set port $used_port`. In theory, it should throw the error `Unable to listen on this port*`. But it failed on MacOs. We solve it by adding `-myaddr 127.0.0.1` to the socket call.
This commit is contained in:
parent
e3c0ea1cb4
commit
e57a4db5d7
@ -199,6 +199,8 @@ start_server {tags {"introspection"}} {
|
||||
set-proc-title
|
||||
cluster-config-file
|
||||
cluster-port
|
||||
oom-score-adj
|
||||
oom-score-adj-values
|
||||
}
|
||||
|
||||
if {!$::tls} {
|
||||
@ -362,20 +364,21 @@ start_server {tags {"introspection"}} {
|
||||
lappend backups $c [lindex [r config get $c] 1]
|
||||
}
|
||||
|
||||
|
||||
set used_port [expr ([dict get $backups port]+1)%65536]
|
||||
set used_port [find_available_port $::baseport $::portcount]
|
||||
dict set some_configs port $used_port
|
||||
|
||||
|
||||
# Run a dummy server on used_port so we know we can't configure redis to
|
||||
# use it. It's ok for this to fail because that means used_port is invalid
|
||||
# anyway
|
||||
catch {socket -server dummy_accept $used_port}
|
||||
catch {socket -server dummy_accept -myaddr 127.0.0.1 $used_port} e
|
||||
if {$::verbose} { puts "dummy_accept: $e" }
|
||||
|
||||
# Try to listen on the used port, pass some more configs to make sure the
|
||||
# returned failure message is for the first bad config and everything is rolled back.
|
||||
assert_error "ERR Config set failed - Unable to listen on this port*" {
|
||||
eval "r config set $some_configs"
|
||||
}
|
||||
|
||||
# Make sure we reverted back to previous configs
|
||||
dict for {conf val} $backups {
|
||||
assert_equal [lindex [r config get $conf] 1] $val
|
||||
|
Loading…
x
Reference in New Issue
Block a user