X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/abf54ee73c9dcfa26a1caefcb51cd0b0ee9b3afd..9c00f078978e452d541ddc8a9a2b7704db2cb7f3:/tests/test_helper.tcl?ds=sidebyside diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 598a3929..b2e58b44 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -11,6 +11,7 @@ source tests/support/util.tcl set ::all_tests { unit/printver + unit/dump unit/auth unit/protocol unit/basic @@ -23,7 +24,7 @@ set ::all_tests { unit/sort unit/expire unit/other - unit/cas + unit/multi unit/quit unit/aofrw integration/replication @@ -40,7 +41,7 @@ set ::all_tests { unit/introspection unit/limits unit/obuf-limits - unit/dump + unit/bitops } # Index to the next test to run in the ::all_tests list. set ::next_test 0 @@ -404,6 +405,18 @@ for {set j 0} {$j < [llength $argv]} {incr j} { } } +# With the parallel test running multiple Redis instances at the same time +# we need a fast enough computer, otherwise a lot of tests may generate +# false positives. +# If the computer is too slow we revert the sequetial test without any +# parallelism, that is, clients == 1. +proc is_a_slow_computer {} { + set start [clock milliseconds] + for {set j 0} {$j < 1000000} {incr j} {} + set elapsed [expr [clock milliseconds]-$start] + expr {$elapsed > 200} +} + if {$::client} { if {[catch { test_client_main $::test_server_port } err]} { set estr "Executing test client: $err.\n$::errorInfo" @@ -413,6 +426,11 @@ if {$::client} { exit 1 } } else { + if {[is_a_slow_computer]} { + puts "** SLOW COMPUTER ** Using a single client to avoid false positives." + set ::numclients 1 + } + if {[catch { test_server_main } err]} { if {[string length $err] > 0} { # only display error when not generated by the test suite