diff --git a/src/test/java/org/opensearch/performanceanalyzer/reader_writer_shared/EventLogFileHandlerTests.java b/src/test/java/org/opensearch/performanceanalyzer/reader_writer_shared/EventLogFileHandlerTests.java index 35699410..ebb4a5fc 100644 --- a/src/test/java/org/opensearch/performanceanalyzer/reader_writer_shared/EventLogFileHandlerTests.java +++ b/src/test/java/org/opensearch/performanceanalyzer/reader_writer_shared/EventLogFileHandlerTests.java @@ -100,6 +100,12 @@ public void testFileWithMetrics() throws InterruptedException { @Test public void testNoFileWithNoMetrics() throws InterruptedException { + // Waiting and calling purgeQueueAndPersist method + // for tmp file to be renamed to timestamp file + Thread.sleep(5_000); + // Clearing out all the files in the directory again before we start. + eventLogFileHandler.deleteAllFilesWithPrivilege(); + queuePurgerAndPersistor.purgeQueueAndPersist(); String bucketTime1 = String.valueOf(getTimeBucket()); assertFalse(