diff --git a/server/src/test/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryTests.java b/server/src/test/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryTests.java index 09bbad04408f5..e2ebb2e642bfe 100644 --- a/server/src/test/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryTests.java +++ b/server/src/test/java/org/opensearch/index/store/RemoteSegmentStoreDirectoryTests.java @@ -61,7 +61,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; -import java.util.regex.Pattern; import java.util.stream.Collectors; import org.mockito.Mockito; @@ -995,20 +994,6 @@ public void testDeleteStaleCommitsActualDelete() throws Exception { .map(metadata -> metadata.split(RemoteSegmentStoreDirectory.UploadedSegmentMetadata.SEPARATOR)[1]) .collect(Collectors.toList()); - final String allFilesPattern = filesToBeDeleted.stream() - .map(Pattern::quote) // Make sure filenames are matched literally - .map(file -> "(?=.*?" + file + ")") // Allow for matches in any order - .collect(Collectors.joining("", "deletedSegmentFiles=\\[", ".*\\]")); - - appender.addExpectation( - new MockLogAppender.PatternSeenWithLoggerPrefixExpectation( - "Deleted file segments message", - "org.opensearch.index.store.RemoteSegmentStoreDirectory", - Level.DEBUG, - allFilesPattern - ) - ); - remoteSegmentStoreDirectory.init(); // popluateMetadata() adds stub to return 3 metadata files