1 start_server
{tags
{"other"}} {
2 test
{SAVE
- make sure there are all the types as values
} {
3 # Wait for a background saving in progress to terminate
5 r lpush mysavelist hello
6 r lpush mysavelist world
8 r
set mynormalkey
{blablablba
}
10 r zadd mytestzset
20 b
11 r zadd mytestzset
30 c
16 foreach fuzztype
{binary alpha compr
} {
17 test
"FUZZ stresser with data model $fuzztype" {
19 for {set i
0} {$i < 10000} {incr i
} {
20 set fuzz
[randstring
0 512 $fuzztype]
24 set err
[list $fuzz $got]
44 test
{SELECT an out of range DB
} {
45 catch {r select
1000000} err
49 tags
{consistency nodiskstore
} {
50 if {![catch {package require sha1
}]} {
51 test
{Check consistency of different data types
after a reload
} {
53 createComplexDataset r
10000
55 set sha1
[r debug digest
]
57 set sha1_after
[r debug digest
]
58 if {$sha1 eq
$sha1_after} {
61 set newdump
[csvdump r
]
62 puts "Consistency test failed!"
63 puts "You can inspect the two dumps in /tmp/repldump*.txt"
65 set fd
[open /tmp
/repldump1.txt w
]
68 set fd
[open /tmp
/repldump2.txt w
]
76 test
{Same dataset digest
if saving
/reloading as AOF?
} {
80 set sha1_after
[r debug digest
]
81 if {$sha1 eq
$sha1_after} {
84 set newdump
[csvdump r
]
85 puts "Consistency test failed!"
86 puts "You can inspect the two dumps in /tmp/aofdump*.txt"
88 set fd
[open /tmp
/aofdump1.txt w
]
91 set fd
[open /tmp
/aofdump2.txt w
]
101 test
{EXPIRES
after a reload
(snapshot
+ append only
file)} {
112 set e1
[expr {$ttl > 900 && $ttl <= 1000}]
115 waitForBgrewriteaof r
119 set e2
[expr {$ttl > 900 && $ttl <= 1000}]
123 test
{PIPELINING stresser
(also a regression
for the old epoll bug
)} {
124 set fd2
[socket $::host $::port]
125 fconfigure $fd2 -encoding binary -translation binary
126 puts -nonewline $fd2 "SELECT 9\r\n"
130 for {set i
0} {$i < 100000} {incr i
} {
132 set val
"0000${i}0000"
133 append q
"SET key:$i $val\r\n"
134 puts -nonewline $fd2 $q
136 append q
"GET key:$i\r\n"
137 puts -nonewline $fd2 $q
141 for {set i
0} {$i < 100000} {incr i
} {
144 set count
[string range
$count 1 end
]
145 set val
[read $fd2 $count]
152 test
{MUTLI
/ EXEC basics
} {
158 set v1
[r
lrange mylist
0 -1]
162 } {QUEUED QUEUED
{{a b c
} PONG
}}
170 set v1
[r del mylist
]
172 set v3
[r
lrange mylist
0 -1]
174 } {QUEUED OK
{a b c
}}
176 test
{Nested MULTI are not allowed
} {
179 catch {[r multi
]} err
184 test
{WATCH inside MULTI is not allowed
} {
187 catch {[r watch x
]} err
192 test
{APPEND basics
} {
193 list [r
append foo bar
] [r get foo
] \
194 [r
append foo
100] [r get foo
]
197 test
{APPEND basics
, integer encoded values
} {
202 lappend res
[r get foo
]
205 lappend res
[r get foo
]
208 test
{APPEND fuzzing
} {
210 foreach type
{binary alpha compr
} {
213 for {set i
0} {$i < 1000} {incr i
} {
214 set bin
[randstring
0 10 $type]
218 if {$buf != [r get x
]} {
219 set err
"Expected '$buf' found '[r get x]'"
226 # Leave the user with a clean DB before to exit
231 lappend aux
[r dbsize
]
234 lappend aux
[r dbsize
]
237 test
{Perform a final SAVE to leave a clean DB on disk
} {