Commit b04ce2a3 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Merge master with resolved conflict in src/redis-cli.c

parents 4fe83b55 b4f2e412
...@@ -140,12 +140,19 @@ proc findKeyWithType {r type} { ...@@ -140,12 +140,19 @@ proc findKeyWithType {r type} {
return {} return {}
} }
proc createComplexDataset {r ops} { proc createComplexDataset {r ops {opt {}}} {
for {set j 0} {$j < $ops} {incr j} { for {set j 0} {$j < $ops} {incr j} {
set k [randomKey] set k [randomKey]
set k2 [randomKey] set k2 [randomKey]
set f [randomValue] set f [randomValue]
set v [randomValue] set v [randomValue]
if {[lsearch -exact $opt useexpire] != -1} {
if {rand() < 0.1} {
{*}$r expire [randomKey] [randomInt 2]
}
}
randpath { randpath {
set d [expr {rand()}] set d [expr {rand()}]
} { } {
......
...@@ -25,7 +25,14 @@ proc execute_tests name { ...@@ -25,7 +25,14 @@ proc execute_tests name {
# are nested, use "srv 0 pid" to get the pid of the inner server. To access # are nested, use "srv 0 pid" to get the pid of the inner server. To access
# outer servers, use "srv -1 pid" etcetera. # outer servers, use "srv -1 pid" etcetera.
set ::servers {} set ::servers {}
proc srv {level property} { proc srv {args} {
set level 0
if {[string is integer [lindex $args 0]]} {
set level [lindex $args 0]
set property [lindex $args 1]
} else {
set property [lindex $args 0]
}
set srv [lindex $::servers end+$level] set srv [lindex $::servers end+$level]
dict get $srv $property dict get $srv $property
} }
...@@ -88,6 +95,7 @@ proc main {} { ...@@ -88,6 +95,7 @@ proc main {} {
execute_tests "unit/cas" execute_tests "unit/cas"
execute_tests "integration/replication" execute_tests "integration/replication"
execute_tests "integration/aof" execute_tests "integration/aof"
# execute_tests "integration/redis-cli"
execute_tests "unit/pubsub" execute_tests "unit/pubsub"
# run tests with VM enabled # run tests with VM enabled
......
...@@ -148,12 +148,11 @@ start_server {tags {"basic"}} { ...@@ -148,12 +148,11 @@ start_server {tags {"basic"}} {
r get novar2 r get novar2
} {foobared} } {foobared}
test {SETNX will overwrite EXPIREing key} { test {SETNX against volatile key} {
r set x 10 r set x 10
r expire x 10000 r expire x 10000
r setnx x 20 list [r setnx x 20] [r get x]
r get x } {0 10}
} {20}
test {EXISTS} { test {EXISTS} {
set res {} set res {}
...@@ -362,13 +361,6 @@ start_server {tags {"basic"}} { ...@@ -362,13 +361,6 @@ start_server {tags {"basic"}} {
list [r msetnx x1 xxx y2 yyy] [r get x1] [r get y2] list [r msetnx x1 xxx y2 yyy] [r get x1] [r get y2]
} {1 xxx yyy} } {1 xxx yyy}
test {MSETNX should remove all the volatile keys even on failure} {
r mset x 1 y 2 z 3
r expire y 10000
r expire z 10000
list [r msetnx x A y B z C] [r mget x y z]
} {0 {1 {} {}}}
test {STRLEN against non existing key} { test {STRLEN against non existing key} {
r strlen notakey r strlen notakey
} {0} } {0}
......
This diff is collapsed.
start_server {} { start_server {tags {"other"}} {
test {SAVE - make sure there are all the types as values} { test {SAVE - make sure there are all the types as values} {
# Wait for a background saving in progress to terminate # Wait for a background saving in progress to terminate
waitForBgsave r waitForBgsave r
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment