You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2020/05/16 15:25:09 UTC

[flink] 05/14: [hotfix][tests] Make FsCheckpointStateOutputStreamTest work on Windows OS

This is an automated email from the ASF dual-hosted git repository.

sewen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 21f8234dad2406e864ef1f91630ad5594becb414
Author: Stephan Ewen <se...@apache.org>
AuthorDate: Sat May 16 00:42:17 2020 +0200

    [hotfix][tests] Make FsCheckpointStateOutputStreamTest work on Windows OS
---
 .../runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java
index d713e44..de9b0e3 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java
@@ -53,6 +53,7 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.anyBoolean;
 import static org.mockito.Matchers.eq;
@@ -365,7 +366,9 @@ public class FsCheckpointStateOutputStreamTest {
 		final File directory = tempDir.newFolder();
 
 		// prevent creation of files in that directory
-		assertTrue(directory.setWritable(false, true));
+		// this operation does not work reliably on Windows, so we use an "assume" to skip the test
+		// is this prerequisite operation is not supported.
+		assumeTrue(directory.setWritable(false, true));
 		checkDirectoryNotWritable(directory);
 
 		FileSystem fs = spy(FileSystem.getLocalFileSystem());