]> git.saurik.com Git - redis.git/commitdiff
Test: check if MIGRATE is caching connections.
authorantirez <antirez@gmail.com>
Tue, 13 Nov 2012 17:11:48 +0000 (18:11 +0100)
committerantirez <antirez@gmail.com>
Wed, 14 Nov 2012 09:58:34 +0000 (10:58 +0100)
tests/unit/dump.tcl

index 202098da2b5ef8a473952b0d378aeb40026b06d9..4ebce0ca2314c837862ac4aa454924215a0af687 100644 (file)
@@ -186,4 +186,23 @@ start_server {tags {"dump"}} {
             assert_match {IOERR*} $e
         }
     }
+
+    test {MIGRATE is caching connections} {
+        set first [srv 0 client]
+        r set key "Some Value"
+        start_server {tags {"repl"}} {
+            set second [srv 0 client]
+            set second_host [srv 0 host]
+            set second_port [srv 0 port]
+
+            assert {[$first exists key] == 1}
+            assert {[$second exists key] == 0}
+
+            set rd [redis_deferring_client]
+            $rd debug sleep 5.0 ; # Make second server unable to reply.
+            set e {}
+            catch {r -1 migrate $second_host $second_port key 9 1000} e
+            assert_match {IOERR*} $e
+        }
+    }
 }