diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneChaosCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneChaosCluster.java index 8bef479419..059af5a8b5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneChaosCluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneChaosCluster.java @@ -136,11 +136,13 @@ void stopChaos() throws Exception { } public void shutdown() { - super.shutdown(); try { stopChaos(); executorService.shutdown(); executorService.awaitTermination(1, TimeUnit.DAYS); + //this should be called after stopChaos to be sure that the + //datanode collection is not modified during the shutdown + super.shutdown(); } catch (Exception e) { LOG.error("failed to shutdown MiniOzoneChaosCluster", e); }