Test: new randomized stress tester for #3343 alike bugs.
This commit is contained in:
parent
f983318e52
commit
24bd9b19f6
@ -27,8 +27,33 @@ start_server {
|
||||
} {PONG}
|
||||
|
||||
test {Stress tester for #3343-alike bugs} {
|
||||
for {set j 0} {$j < 100} {incr j} {
|
||||
puts [randomInt 10]
|
||||
r del key
|
||||
for {set j 0} {$j < 10000} {incr j} {
|
||||
set op [randomInt 6]
|
||||
set small_signed_count [expr 5-[randomInt 10]]
|
||||
if {[randomInt 2] == 0} {
|
||||
set ele [randomInt 1000]
|
||||
} else {
|
||||
set ele [string repeat x [randomInt 10000]][randomInt 1000]
|
||||
}
|
||||
switch $op {
|
||||
0 {r lpush key $ele}
|
||||
1 {r rpush key $ele}
|
||||
2 {r lpop key}
|
||||
3 {r rpop key}
|
||||
4 {
|
||||
catch {r lset key $small_signed_count $ele}
|
||||
}
|
||||
5 {
|
||||
set otherele [randomInt 1000]
|
||||
if {[randomInt 2] == 0} {
|
||||
set where before
|
||||
} else {
|
||||
set where after
|
||||
}
|
||||
r linsert key $where $otherele $ele
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user