From f2b182dcdb7f08d2d66cfab5c0b3ce58d758bcc8 Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Fri, 9 Dec 2022 13:36:43 -0800 Subject: [PATCH] Properly skip OnDemandBlockSnapshotIndexInputTests.testVariousBlockSize on Windows. PR https://github.com/opensearch-project/OpenSearch/pull/5397 skipped this test in @Before block but still frequently throws a TestCouldNotBeSkippedException. This is caused by the after block still executing and throwing an exception while cleaning the directory created at the path in @Before. Moving the assumption to the individual test prevents this exception by ensuring the path exists. Signed-off-by: Marc Handalian --- .../store/remote/file/OnDemandBlockSnapshotIndexInputTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/org/opensearch/index/store/remote/file/OnDemandBlockSnapshotIndexInputTests.java b/server/src/test/java/org/opensearch/index/store/remote/file/OnDemandBlockSnapshotIndexInputTests.java index 6f3387a935c03..9104ab1a6882b 100644 --- a/server/src/test/java/org/opensearch/index/store/remote/file/OnDemandBlockSnapshotIndexInputTests.java +++ b/server/src/test/java/org/opensearch/index/store/remote/file/OnDemandBlockSnapshotIndexInputTests.java @@ -53,7 +53,6 @@ public class OnDemandBlockSnapshotIndexInputTests extends OpenSearchTestCase { @Before public void init() { - assumeFalse("Awaiting Windows fix https://github.com/opensearch-project/OpenSearch/issues/5396", Constants.WINDOWS); transferManager = mock(TransferManager.class); lockFactory = SimpleFSLockFactory.INSTANCE; path = LuceneTestCase.createTempDir("OnDemandBlockSnapshotIndexInputTests"); @@ -69,6 +68,7 @@ public void clean() { } public void testVariousBlockSize() throws Exception { + assumeFalse("Awaiting Windows fix https://github.com/opensearch-project/OpenSearch/issues/5396", Constants.WINDOWS); int fileSize = 29360128; int blockSizeShift;