"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/support/server.tcl" between
redis-6.2-rc3.tar.gz and redis-6.2.0.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

server.tcl  (redis-6.2-rc3):server.tcl  (redis-6.2.0)
skipping to change at line 262 skipping to change at line 262
# Check if the port is actually busy and the server failed # Check if the port is actually busy and the server failed
# for this reason. # for this reason.
if {[regexp {Could not create server TCP} [exec cat $stdout]]} { if {[regexp {Could not create server TCP} [exec cat $stdout]]} {
set port_busy 1 set port_busy 1
break break
} }
} }
return $port_busy return $port_busy
} }
proc dump_server_log {srv} {
set pid [dict get $srv "pid"]
puts "\n===== Start of server log (pid $pid) =====\n"
puts [exec cat [dict get $srv "stdout"]]
puts "===== End of server log (pid $pid) =====\n"
}
proc start_server {options {code undefined}} { proc start_server {options {code undefined}} {
# setup defaults # setup defaults
set baseconfig "default.conf" set baseconfig "default.conf"
set overrides {} set overrides {}
set omit {} set omit {}
set tags {} set tags {}
set keep_persistence false set keep_persistence false
# parse options # parse options
foreach {option value} $options { foreach {option value} $options {
skipping to change at line 495 skipping to change at line 502
} }
after 10 after 10
} }
# append the server to the stack # append the server to the stack
lappend ::servers $srv lappend ::servers $srv
# connect client (after server dict is put on the stack) # connect client (after server dict is put on the stack)
reconnect reconnect
# remember previous num_failed to catch new errors
set prev_num_failed $::num_failed
# execute provided block # execute provided block
set num_tests $::num_tests set num_tests $::num_tests
if {[catch { uplevel 1 $code } error]} { if {[catch { uplevel 1 $code } error]} {
set backtrace $::errorInfo set backtrace $::errorInfo
# fetch srv back from the server list, in case it was restarted by r estart_server (new PID) # fetch srv back from the server list, in case it was restarted by r estart_server (new PID)
set srv [lindex $::servers end] set srv [lindex $::servers end]
# pop the server object # pop the server object
set ::servers [lrange $::servers 0 end-1] set ::servers [lrange $::servers 0 end-1]
skipping to change at line 532 skipping to change at line 542
lappend details $msg lappend details $msg
lappend details $backtrace lappend details $backtrace
lappend ::tests_failed $details lappend ::tests_failed $details
incr ::num_failed incr ::num_failed
send_data_packet $::test_server_fd err [join $details "\n"] send_data_packet $::test_server_fd err [join $details "\n"]
} else { } else {
# Re-raise, let handler up the stack take care of this. # Re-raise, let handler up the stack take care of this.
error $error $backtrace error $error $backtrace
} }
} else {
if {$::dump_logs && $prev_num_failed != $::num_failed} {
dump_server_log $srv
}
} }
# fetch srv back from the server list, in case it was restarted by resta rt_server (new PID) # fetch srv back from the server list, in case it was restarted by resta rt_server (new PID)
set srv [lindex $::servers end] set srv [lindex $::servers end]
# Don't do the leak check when no tests were run # Don't do the leak check when no tests were run
if {$num_tests == $::num_tests} { if {$num_tests == $::num_tests} {
dict set srv "skipleaks" 1 dict set srv "skipleaks" 1
} }
 End of changes. 3 change blocks. 
0 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)