Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Jan 12, 2019
1 parent d219e6a commit 0807874
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/test/java/org/kafkahq/KafkaTestCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ public void run() {
injectTestData();
logger.info("Test data injected");

Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
Files.delete(CS_PATH);
} catch (Exception e) {
logger.error("Can't delete CS file", e);
}
}));
if (reuse) {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
Files.delete(CS_PATH);
} catch (Exception e) {
logger.error("Can't delete CS file", e);
}
}));
}

} catch (Exception e) {
throw new RuntimeException(e);
Expand Down Expand Up @@ -146,7 +148,7 @@ private void injectTestData() throws InterruptedException, ExecutionException {
testUtils.produceRecords(randomDatas(50, 0), TOPIC_COMPACTED, partition);
}

Thread.sleep(100L);
Thread.sleep(1000L);
}

private static Map<byte[], byte[]> randomDatas(int size, Integer start) {
Expand Down

0 comments on commit 0807874

Please sign in to comment.