From a330b6ca97dc92222e0405e6cbae552f5aa324eb Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 22 Jan 2015 11:10:43 +0100 Subject: [PATCH 1/2] The seed must be static in getRandomHexChars(). --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index f995bf1ea..543de112b 100644 --- a/src/util.c +++ b/src/util.c @@ -431,10 +431,10 @@ int d2string(char *buf, size_t len, double value) { void getRandomHexChars(char *p, unsigned int len) { char *charset = "0123456789abcdef"; unsigned int j; - unsigned char seed[20]; /* A seed to have a different sequence each run. */ /* Global state. */ static int seed_initialized = 0; + static unsigned char seed[20]; /* The SHA1 seed, from /dev/urandom. */ static uint64_t counter = 0; /* The counter we hash with the seed. */ if (!seed_initialized) { From d5ba544e674cf7606f1d7fedf5802cd9bc4037f4 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 22 Jan 2015 16:08:21 +0100 Subject: [PATCH 2/2] Cluster test: when valgrind is enabled, use a larger node-timeout. Removes some percentage of timing related failures. --- tests/cluster/tests/includes/init-tests.tcl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/cluster/tests/includes/init-tests.tcl b/tests/cluster/tests/includes/init-tests.tcl index 117f79208..466ab8f25 100644 --- a/tests/cluster/tests/includes/init-tests.tcl +++ b/tests/cluster/tests/includes/init-tests.tcl @@ -27,12 +27,17 @@ test "Cluster nodes are reachable" { test "Cluster nodes hard reset" { foreach_redis_id id { + if {$::valgrind} { + set node_timeout 10000 + } else { + set node_timeout 3000 + } catch {R $id flushall} ; # May fail for readonly slaves. R $id MULTI R $id cluster reset hard R $id cluster set-config-epoch [expr {$id+1}] R $id EXEC - R $id config set cluster-node-timeout 3000 + R $id config set cluster-node-timeout $node_timeout R $id config set cluster-slave-validity-factor 10 R $id config rewrite }