Minor improvements to PR #5187.

This commit is contained in:
antirez 2018-07-31 17:28:30 +02:00
parent 7b41701eb8
commit 7a30be1237
2 changed files with 13 additions and 6 deletions

View File

@ -33,9 +33,8 @@ start_server {} {
set cycle 1 set cycle 1
while {([clock seconds]-$start_time) < $duration} { while {([clock seconds]-$start_time) < $duration} {
test "PSYNC2: --- CYCLE $cycle ---" { test "PSYNC2: --- CYCLE $cycle ---" {}
incr cycle incr cycle
}
# Create a random replication layout. # Create a random replication layout.
# Start with switching master (this simulates a failover). # Start with switching master (this simulates a failover).
@ -139,6 +138,11 @@ start_server {} {
} }
assert {$sum == 4} assert {$sum == 4}
} }
# Limit anyway the maximum number of cycles. This is useful when the
# test is skipped via --only option of the test suite. In that case
# we don't want to see many seconds of this test being just skipped.
if {$cycle > 50} break
} }
test "PSYNC2: Bring the master back again for next test" { test "PSYNC2: Bring the master back again for next test" {

View File

@ -429,7 +429,7 @@ proc print_help_screen {} {
"--single <unit> Just execute the specified unit (see next option). this option can be repeated." "--single <unit> Just execute the specified unit (see next option). this option can be repeated."
"--list-tests List all the available test units." "--list-tests List all the available test units."
"--only <test> Just execute the specified test by test name. this option can be repeated." "--only <test> Just execute the specified test by test name. this option can be repeated."
"--skiptill <unit> Skip all units until (and including) the specified one." "--skip-till <unit> Skip all units until (and including) the specified one."
"--clients <num> Number of test clients (default 16)." "--clients <num> Number of test clients (default 16)."
"--timeout <sec> Test timeout in seconds (default 10 min)." "--timeout <sec> Test timeout in seconds (default 10 min)."
"--force-failure Force the execution of a test that always fails." "--force-failure Force the execution of a test that always fails."
@ -458,8 +458,7 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
set arg2 [lindex $argv [expr $j+2]] set arg2 [lindex $argv [expr $j+2]]
lappend ::global_overrides $arg lappend ::global_overrides $arg
lappend ::global_overrides $arg2 lappend ::global_overrides $arg2
incr j incr j 2
incr j
} elseif {$opt eq {--skipfile}} { } elseif {$opt eq {--skipfile}} {
incr j incr j
set fp [open $arg r] set fp [open $arg r]
@ -524,6 +523,8 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
} }
} }
# If --skil-till option was given, we populate the list of single tests
# to run with everything *after* the specified unit.
if {$::skip_till != ""} { if {$::skip_till != ""} {
set skipping 1 set skipping 1
foreach t $::all_tests { foreach t $::all_tests {
@ -540,6 +541,8 @@ if {$::skip_till != ""} {
} }
} }
# Override the list of tests with the specific tests we want to run
# in case there was some filter, that is --single or --skip-till options.
if {[llength $::single_tests] > 0} { if {[llength $::single_tests] > 0} {
set ::all_tests $::single_tests set ::all_tests $::single_tests
} }