diff --git a/src/main/java/redis/embedded/RedisServer.java b/src/main/java/redis/embedded/RedisServer.java index 4861a11c..87aaf725 100644 --- a/src/main/java/redis/embedded/RedisServer.java +++ b/src/main/java/redis/embedded/RedisServer.java @@ -194,7 +194,12 @@ private void awaitRedisServerReady() throws IOException { String outputLine = null; do { outputLine = reader.readLine(); - } while (outputLine != null && !outputLine.matches(REDIS_READY_PATTERN)); + + if (outputLine == null) { + //Something goes wrong. Stream is ended before server was activated. + throw new RuntimeException("Can't start redis server. Check logs for details."); + } + } while (!outputLine.matches(REDIS_READY_PATTERN)); } finally { reader.close(); }