Skip to content

Commit

Permalink
Minor fix for --loops option in normal testing framework (valkey-io#781)
Browse files Browse the repository at this point in the history
Inputing a negative number equivalent to --loop, and inputing a
number greater than or equal to 0 will cause the tests to be run
one more time.

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin authored Jul 13, 2024
1 parent a4ee8da commit 8c92b2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ proc signal_idle_client fd {
send_data_packet $fd run [lindex $::all_tests $::next_test]
lappend ::active_clients $fd
incr ::next_test
if {$::loop && $::next_test == [llength $::all_tests]} {
if {$::loop > 1 && $::next_test == [llength $::all_tests]} {
set ::next_test 0
incr ::loop -1
}
Expand Down Expand Up @@ -703,6 +703,10 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
set ::loop 2147483647
} elseif {$opt eq {--loops}} {
set ::loop $arg
if {$::loop <= 0} {
puts "Wrong argument: $opt, loops should be greater than 0"
exit 1
}
incr j
} elseif {$opt eq {--timeout}} {
set ::timeout $arg
Expand Down

0 comments on commit 8c92b2f

Please sign in to comment.