diff options
author | antirez <antirez@gmail.com> | 2011-10-04 10:05:21 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-10-04 10:05:21 +0200 |
commit | 24bfb570ee7f9f10eccdf034f5c772b84b876f5f (patch) | |
tree | ddf50def644c9a7bf0f958da95ccfbdcd0af5375 /tests/support | |
parent | 0bb5160cb08ad8f16ce241e55a1ed6c3042bf2aa (diff) | |
download | redis-24bfb570ee7f9f10eccdf034f5c772b84b876f5f.tar.gz |
Redis test ports selection made more robust. This prevents the test from hanging if an already bound port is selected but the TCP server listening to it does not cause a protocol error with a Redis client PING. Also base port moved away from the range near to the Redis Cluster gossip ports.
Diffstat (limited to 'tests/support')
-rw-r--r-- | tests/support/server.tcl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/support/server.tcl b/tests/support/server.tcl index 3fa1725f3..c2d7132d2 100644 --- a/tests/support/server.tcl +++ b/tests/support/server.tcl @@ -154,7 +154,8 @@ proc start_server {options {code undefined}} { dict set config dir [tmpdir server] # start every server on a different port - dict set config port [incr ::port] + set ::port [find_available_port [expr {$::port+1}]] + dict set config port $::port # apply overrides from global space and arguments foreach {directive arguments} [concat $::global_overrides $overrides] { |