diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOMSnapshotDAG.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOMSnapshotDAG.java index d23f3389f239..91b370d253e5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOMSnapshotDAG.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOMSnapshotDAG.java @@ -304,10 +304,12 @@ public void testSkipTrackingWithZeroSnapshot() throws IOException { // Verify that no compaction log entry has been written Path logPath = Paths.get(omMetadataDir, compactionLogDirName); File[] fileList = logPath.toFile().listFiles(); - Assertions.assertNotNull(fileList); - for (File file : fileList) { - if (file != null && file.isFile() && file.getName().endsWith(".log")) { - Assertions.assertEquals(0L, file.length()); + // fileList can be null when compaction log directory is not even created + if (fileList != null) { + for (File file : fileList) { + if (file != null && file.isFile() && file.getName().endsWith(".log")) { + Assertions.assertEquals(0L, file.length()); + } } } // Verify that no SST has been backed up