-start_server default.conf {} {
+start_server {} {
test {SAVE - make sure there are all the types as values} {
# Wait for a background saving in progress to terminate
waitForBgsave r
r save
} {OK}
- foreach fuzztype {binary alpha compr} {
- test "FUZZ stresser with data model $fuzztype" {
- set err 0
- for {set i 0} {$i < 10000} {incr i} {
- set fuzz [randstring 0 512 $fuzztype]
- r set foo $fuzz
- set got [r get foo]
- if {$got ne $fuzz} {
- set err [list $fuzz $got]
- break
+ tags {"slow"} {
+ foreach fuzztype {binary alpha compr} {
+ test "FUZZ stresser with data model $fuzztype" {
+ set err 0
+ for {set i 0} {$i < 10000} {incr i} {
+ set fuzz [randstring 0 512 $fuzztype]
+ r set foo $fuzz
+ set got [r get foo]
+ if {$got ne $fuzz} {
+ set err [list $fuzz $got]
+ break
+ }
}
- }
- set _ $err
- } {0}
+ set _ $err
+ } {0}
+ }
}
test {BGSAVE} {
set _ $err
} {*invalid*}
- if {![catch {package require sha1}]} {
- test {Check consistency of different data types after a reload} {
- r flushdb
- createComplexDataset r 10000
- set sha1 [r debug digest]
- r debug reload
- set sha1_after [r debug digest]
- expr {$sha1 eq $sha1_after}
- } {1}
-
- test {Same dataset digest if saving/reloading as AOF?} {
- r bgrewriteaof
- waitForBgrewriteaof r
- r debug loadaof
- set sha1_after [r debug digest]
- expr {$sha1 eq $sha1_after}
- } {1}
+ tags {consistency} {
+ if {![catch {package require sha1}]} {
+ test {Check consistency of different data types after a reload} {
+ r flushdb
+ createComplexDataset r 10000
+ set dump [csvdump r]
+ set sha1 [r debug digest]
+ r debug reload
+ r set baubau x
+ set sha1_after [r debug digest]
+ if {$sha1 eq $sha1_after} {
+ set _ 1
+ } else {
+ set newdump [csvdump r]
+ puts "Consistency test failed!"
+ puts "You can inspect the two dumps in /tmp/repldump*.txt"
+
+ set fd [open /tmp/repldump1.txt w]
+ puts $fd $dump
+ close $fd
+ set fd [open /tmp/repldump2.txt w]
+ puts $fd $newdump
+ close $fd
+
+ set _ 0
+ }
+ } {1}
+
+ test {Same dataset digest if saving/reloading as AOF?} {
+ r bgrewriteaof
+ waitForBgrewriteaof r
+ r debug loadaof
+ set sha1_after [r debug digest]
+ if {$sha1 eq $sha1_after} {
+ set _ 1
+ } else {
+ set newdump [csvdump r]
+ puts "Consistency test failed!"
+ puts "You can inspect the two dumps in /tmp/aofdump*.txt"
+
+ set fd [open /tmp/aofdump1.txt w]
+ puts $fd $dump
+ close $fd
+ set fd [open /tmp/aofdump2.txt w]
+ puts $fd $newdump
+ close $fd
+
+ set _ 0
+ }
+ } {1}
+ }
}
test {EXPIRES after a reload (snapshot + append only file)} {
list $v1 $v2 $v3
} {QUEUED OK {a b c}}
+ test {Nested MULTI are not allowed} {
+ set err {}
+ r multi
+ catch {[r multi]} err
+ r exec
+ set _ $err
+ } {*ERR MULTI*}
+
+ test {WATCH inside MULTI is not allowed} {
+ set err {}
+ r multi
+ catch {[r watch x]} err
+ r exec
+ set _ $err
+ } {*ERR WATCH*}
+
test {APPEND basics} {
list [r append foo bar] [r get foo] \
[r append foo 100] [r get foo]