From 688a34029c7457c73fdaf4a89c1c3b2f0a893efd Mon Sep 17 00:00:00 2001 From: jomo Date: Thu, 3 Nov 2016 21:19:28 +0100 Subject: [PATCH] wait for redis connection before running tests --- test/test.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/test.js b/test/test.js index 1b4aaa7..041219e 100644 --- a/test/test.js +++ b/test/test.js @@ -72,12 +72,16 @@ describe("Crafatar", function() { // we might have to make 2 HTTP requests this.timeout(config.server.http_timeout * 2 + 50); - before(function() { - cache.get_redis().flushall(); - // cause I don't know how big hard drives are these days - config.cleaner.disk_limit = Infinity; - config.cleaner.redis_limit = Infinity; - cleaner.run(); + before(function(done) { + console.log("Flushing and waiting for redis ..."); + cache.get_redis().flushall(function() { + console.log("Redis flushed!"); + // cause I don't know how big hard drives are these days + config.cleaner.disk_limit = Infinity; + config.cleaner.redis_limit = Infinity; + cleaner.run(); + done(); + }); }); describe("UUID/username", function() {