From d09738820ea615ced49aa90abacbc3f2abd2b45a Mon Sep 17 00:00:00 2001 From: Sachin Kale Date: Fri, 12 Apr 2024 15:38:53 +0530 Subject: [PATCH] Fix integ test Signed-off-by: Sachin Kale --- .../java/org/opensearch/remotestore/RemoteStoreIT.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreIT.java b/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreIT.java index b767ffff05e3a..9ffc816ee60bf 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteStoreIT.java @@ -30,6 +30,7 @@ import org.opensearch.index.IndexSettings; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.IndexShardClosedException; +import org.opensearch.index.store.RemoteSegmentStoreDirectory; import org.opensearch.index.translog.Translog.Durability; import org.opensearch.indices.IndicesService; import org.opensearch.indices.RemoteStoreSettings; @@ -585,7 +586,9 @@ public void testFallbackToNodeToNodeSegmentCopy() throws Exception { try (Stream files = Files.list(segmentDataPath)) { files.forEach(p -> { try { - Files.delete(p); + if (p.getFileName().toString().startsWith(RemoteSegmentStoreDirectory.SEGMENT_INFOS_SNAPSHOT_PREFIX) == false) { + Files.delete(p); + } } catch (IOException e) { // Ignore }