From b6dc4a08918729aec8f74ef9383546c4f3b8a582 Mon Sep 17 00:00:00 2001 From: Rui Gu Date: Fri, 1 Apr 2016 14:21:11 +0100 Subject: [PATCH] Improvement to RedisRunner Reduced output produced on travis changed wait time after runner the instance from 3 sec to 1.5 sec --- src/test/java/org/redisson/RedisRunner.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/redisson/RedisRunner.java b/src/test/java/org/redisson/RedisRunner.java index b2a11d79b..3a96927dd 100644 --- a/src/test/java/org/redisson/RedisRunner.java +++ b/src/test/java/org/redisson/RedisRunner.java @@ -222,14 +222,14 @@ public class RedisRunner { BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; try { - while (p.isAlive() && (line = reader.readLine()) != null) { + while (p.isAlive() && (line = reader.readLine()) != null && !"true".equalsIgnoreCase(System.getProperty("travisEnv"))) { System.out.println("REDIS PROCESS: " + line); } } catch (IOException ex) { System.out.println("Exception: " + ex.getLocalizedMessage()); } }).start(); - Thread.sleep(3000); + Thread.sleep(1500); return new RedisProcess(p, runner); } @@ -681,7 +681,7 @@ public class RedisRunner { public boolean deleteDBfileDir() { File f = new File(defaultDir); if (f.exists()) { - System.out.println("RedisRunner: Deleting directory " + defaultDir); + System.out.println("REDIS RUNNER: Deleting directory " + defaultDir); return f.delete(); } return false; @@ -692,7 +692,7 @@ public class RedisRunner { if (f.exists()) { makeRandomDefaultDir(); } else { - System.out.println("RedisRunner: Making directory " + f.getAbsolutePath()); + System.out.println("REDIS RUNNER: Making directory " + f.getAbsolutePath()); f.mkdirs(); this.defaultDir = f.getAbsolutePath(); } @@ -736,7 +736,7 @@ public class RedisRunner { public static RedisRunner.RedisProcess startDefaultRedisTestInstance() throws IOException, InterruptedException { if (defaultRedisInstance == null) { - System.out.println("REDIS PROCESS: Starting up default instance..."); + System.out.println("REDIS RUNNER: Starting up default instance..."); defaultRedisInstance = new RedisRunner().nosave().randomDir().run(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { @@ -750,14 +750,14 @@ public class RedisRunner { public static int shutDownDefaultRedisTestInstance() throws InterruptedException { if (defaultRedisInstance != null) { - System.out.println("REDIS PROCESS: Shutting down default instance..."); + System.out.println("REDIS RUNNER: Shutting down default instance..."); try { defaultRedisInstanceExitCode = defaultRedisInstance.stop(); } finally { defaultRedisInstance = null; } } else { - System.out.println("REDIS PROCESS: Default instance is already down with an exit code " + defaultRedisInstanceExitCode); + System.out.println("REDIS RUNNER: Default instance is already down with an exit code " + defaultRedisInstanceExitCode); } return defaultRedisInstanceExitCode; }