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
15 tags
{slow nodiskstore
} {
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 tags
{protocol nodiskstore
} {
124 test
{PIPELINING stresser
(also a regression
for the old epoll bug
)} {
125 set fd2
[socket $::host $::port]
126 fconfigure $fd2 -encoding binary -translation binary
127 puts -nonewline $fd2 "SELECT 9\r\n"
131 for {set i
0} {$i < 100000} {incr i
} {
133 set val
"0000${i}0000"
134 append q
"SET key:$i $val\r\n"
135 puts -nonewline $fd2 $q
137 append q
"GET key:$i\r\n"
138 puts -nonewline $fd2 $q
142 for {set i
0} {$i < 100000} {incr i
} {
145 set count
[string range
$count 1 end
]
146 set val
[read $fd2 $count]
154 test
{MUTLI
/ EXEC basics
} {
160 set v1
[r
lrange mylist
0 -1]
164 } {QUEUED QUEUED
{{a b c
} PONG
}}
172 set v1
[r del mylist
]
174 set v3
[r
lrange mylist
0 -1]
176 } {QUEUED OK
{a b c
}}
178 test
{Nested MULTI are not allowed
} {
181 catch {[r multi
]} err
186 test
{MULTI where commands alter argc
/argv
} {
190 list [r
exec] [r exists myset
]
193 test
{WATCH inside MULTI is not allowed
} {
196 catch {[r watch x
]} err
201 test
{APPEND basics
} {
202 list [r
append foo bar
] [r get foo
] \
203 [r
append foo
100] [r get foo
]
206 test
{APPEND basics
, integer encoded values
} {
211 lappend res
[r get foo
]
214 lappend res
[r get foo
]
217 test
{APPEND fuzzing
} {
219 foreach type
{binary alpha compr
} {
222 for {set i
0} {$i < 1000} {incr i
} {
223 set bin
[randstring
0 10 $type]
227 if {$buf != [r get x
]} {
228 set err
"Expected '$buf' found '[r get x]'"
235 # Leave the user with a clean DB before to exit
240 lappend aux
[r dbsize
]
243 lappend aux
[r dbsize
]
246 test
{Perform a final SAVE to leave a clean DB on disk
} {