From 30cf7be60c48c0f4931cd58bbd13201c17638b48 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 11 Jul 2011 12:15:35 +0200 Subject: [PATCH] the test runs less iterations of slow tests if no --accurate is given. --- tests/integration/replication-3.tcl | 4 +++- tests/unit/other.tcl | 6 ++++-- tests/unit/type/list-3.tcl | 5 +++-- tests/unit/type/zset.tcl | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/integration/replication-3.tcl b/tests/integration/replication-3.tcl index 80140f20..e660bf4e 100644 --- a/tests/integration/replication-3.tcl +++ b/tests/integration/replication-3.tcl @@ -6,8 +6,10 @@ start_server {tags {"repl"}} { s -1 role } {slave} + if {$::accurate} {set numops 50000} else {set numops 5000} + test {MASTER and SLAVE consistency with expire} { - createComplexDataset r 50000 useexpire + createComplexDataset r $numops useexpire after 4000 ;# Make sure everything expired before taking the digest r keys * ;# Force DEL syntesizing to slave after 1000 ;# Wait another second. Now everything should be fine. diff --git a/tests/unit/other.tcl b/tests/unit/other.tcl index d2663572..20cefc6a 100644 --- a/tests/unit/other.tcl +++ b/tests/unit/other.tcl @@ -13,10 +13,11 @@ start_server {tags {"other"}} { } {OK} tags {slow} { + if {$::accurate} {set iterations 10000} else {set iterations 1000} foreach fuzztype {binary alpha compr} { test "FUZZ stresser with data model $fuzztype" { set err 0 - for {set i 0} {$i < 10000} {incr i} { + for {set i 0} {$i < $iterations} {incr i} { set fuzz [randstring 0 512 $fuzztype] r set foo $fuzz set got [r get foo] @@ -48,9 +49,10 @@ start_server {tags {"other"}} { tags {consistency} { if {![catch {package require sha1}]} { + if {$::accurate} {set numops 10000} else {set numops 1000} test {Check consistency of different data types after a reload} { r flushdb - createComplexDataset r 10000 + createComplexDataset r $numops set dump [csvdump r] set sha1 [r debug digest] r debug reload diff --git a/tests/unit/type/list-3.tcl b/tests/unit/type/list-3.tcl index 8fdb226e..9410022f 100644 --- a/tests/unit/type/list-3.tcl +++ b/tests/unit/type/list-3.tcl @@ -16,7 +16,8 @@ start_server { tags {slow} { test {ziplist implementation: value encoding and backlink} { - for {set j 0} {$j < 100} {incr j} { + if {$::accurate} {set iterations 100} else {set iterations 10} + for {set j 0} {$j < $iterations} {incr j} { r del l set l {} for {set i 0} {$i < 200} {incr i} { @@ -58,7 +59,7 @@ start_server { } } assert_equal [llength $l] [r llen l] - for {set i 0} {$i < 200} {incr i} { + for {set i 0} {$i < $len} {incr i} { if {[lindex $l $i] ne [r lindex l $i]} { assert_equal [lindex $l $i] [r lindex l $i] } diff --git a/tests/unit/type/zset.tcl b/tests/unit/type/zset.tcl index 46d40f6f..41f5f588 100644 --- a/tests/unit/type/zset.tcl +++ b/tests/unit/type/zset.tcl @@ -527,7 +527,7 @@ start_server {tags {"zset"}} { } elseif {$encoding == "skiplist"} { r config set zset-max-ziplist-entries 0 r config set zset-max-ziplist-value 0 - set elements 1000 + if {$::accurate} {set elements 1000} else {set elements 100} } else { puts "Unknown sorted set encoding" exit -- 2.45.2