Skip to content

Commit

Permalink
[FLINK-5412] Enable RocksDB tests on Windows OS
Browse files Browse the repository at this point in the history
This closes #3067.
  • Loading branch information
zentol committed Jan 6, 2017
1 parent 2ed899d commit e13ac59
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
Expand Up @@ -47,15 +47,12 @@
import org.apache.flink.streaming.runtime.tasks.OneInputStreamTaskTestHarness; import org.apache.flink.streaming.runtime.tasks.OneInputStreamTaskTestHarness;
import org.apache.flink.streaming.runtime.tasks.StreamMockEnvironment; import org.apache.flink.streaming.runtime.tasks.StreamMockEnvironment;
import org.apache.flink.streaming.runtime.tasks.StreamTask; import org.apache.flink.streaming.runtime.tasks.StreamTask;
import org.apache.flink.util.OperatingSystem;


import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.LocalFileSystem;


import org.junit.Assert; import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
Expand Down Expand Up @@ -86,11 +83,6 @@
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class RocksDBAsyncSnapshotTest { public class RocksDBAsyncSnapshotTest {


@Before
public void checkOperatingSystem() {
Assume.assumeTrue("This test can't run successfully on Windows.", !OperatingSystem.isWindows());
}

/** /**
* This ensures that asynchronous state handles are actually materialized asynchronously. * This ensures that asynchronous state handles are actually materialized asynchronously.
* *
Expand Down
Expand Up @@ -23,6 +23,7 @@
import org.apache.flink.api.common.TaskInfo; import org.apache.flink.api.common.TaskInfo;
import org.apache.flink.api.common.typeutils.base.IntSerializer; import org.apache.flink.api.common.typeutils.base.IntSerializer;
import org.apache.flink.configuration.Configuration; import org.apache.flink.configuration.Configuration;
import org.apache.flink.core.fs.Path;
import org.apache.flink.runtime.execution.Environment; import org.apache.flink.runtime.execution.Environment;
import org.apache.flink.runtime.io.disk.iomanager.IOManager; import org.apache.flink.runtime.io.disk.iomanager.IOManager;
import org.apache.flink.runtime.jobgraph.JobVertexID; import org.apache.flink.runtime.jobgraph.JobVertexID;
Expand All @@ -31,9 +32,6 @@
import org.apache.flink.runtime.state.KeyGroupRange; import org.apache.flink.runtime.state.KeyGroupRange;
import org.apache.flink.runtime.taskmanager.TaskManagerRuntimeInfo; import org.apache.flink.runtime.taskmanager.TaskManagerRuntimeInfo;
import org.apache.flink.runtime.util.TestingTaskManagerRuntimeInfo; import org.apache.flink.runtime.util.TestingTaskManagerRuntimeInfo;
import org.apache.flink.util.OperatingSystem;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TemporaryFolder; import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -70,11 +68,6 @@ public class RocksDBStateBackendConfigTest {
@Rule @Rule
public TemporaryFolder tempFolder = new TemporaryFolder(); public TemporaryFolder tempFolder = new TemporaryFolder();


@Before
public void checkOperatingSystem() {
Assume.assumeTrue("This test can't run successfully on Windows.", !OperatingSystem.isWindows());
}

// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// RocksDB local file directory // RocksDB local file directory
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Expand All @@ -90,13 +83,13 @@ public void testSetDbPath() throws Exception {
assertNull(rocksDbBackend.getDbStoragePaths()); assertNull(rocksDbBackend.getDbStoragePaths());


rocksDbBackend.setDbStoragePath(testDir1.getAbsolutePath()); rocksDbBackend.setDbStoragePath(testDir1.getAbsolutePath());
assertArrayEquals(new String[] { testDir1.getAbsolutePath() }, rocksDbBackend.getDbStoragePaths()); assertArrayEquals(new String[] { new Path(testDir1.getAbsolutePath()).toString() }, rocksDbBackend.getDbStoragePaths());


rocksDbBackend.setDbStoragePath(null); rocksDbBackend.setDbStoragePath(null);
assertNull(rocksDbBackend.getDbStoragePaths()); assertNull(rocksDbBackend.getDbStoragePaths());


rocksDbBackend.setDbStoragePaths(testDir1.getAbsolutePath(), testDir2.getAbsolutePath()); rocksDbBackend.setDbStoragePaths(testDir1.getAbsolutePath(), testDir2.getAbsolutePath());
assertArrayEquals(new String[] { testDir1.getAbsolutePath(), testDir2.getAbsolutePath() }, rocksDbBackend.getDbStoragePaths()); assertArrayEquals(new String[] { new Path(testDir1.getAbsolutePath()).toString(), new Path(testDir2.getAbsolutePath()).toString() }, rocksDbBackend.getDbStoragePaths());


Environment env = getMockEnvironment(); Environment env = getMockEnvironment();
RocksDBKeyedStateBackend<Integer> keyedBackend = (RocksDBKeyedStateBackend<Integer>) rocksDbBackend. RocksDBKeyedStateBackend<Integer> keyedBackend = (RocksDBKeyedStateBackend<Integer>) rocksDbBackend.
Expand Down
Expand Up @@ -34,9 +34,6 @@
import org.apache.flink.runtime.state.VoidNamespaceSerializer; import org.apache.flink.runtime.state.VoidNamespaceSerializer;
import org.apache.flink.runtime.state.filesystem.FsStateBackend; import org.apache.flink.runtime.state.filesystem.FsStateBackend;
import org.apache.flink.runtime.state.memory.MemCheckpointStreamFactory; import org.apache.flink.runtime.state.memory.MemCheckpointStreamFactory;
import org.apache.flink.util.OperatingSystem;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TemporaryFolder; import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -82,11 +79,6 @@ public class RocksDBStateBackendTest extends StateBackendTestBase<RocksDBStateBa
@Rule @Rule
public TemporaryFolder tempFolder = new TemporaryFolder(); public TemporaryFolder tempFolder = new TemporaryFolder();


@Before
public void checkOS() throws Exception {
Assume.assumeTrue("This test can't run successfully on Windows.", !OperatingSystem.isWindows());
}

@Override @Override
protected RocksDBStateBackend getStateBackend() throws IOException { protected RocksDBStateBackend getStateBackend() throws IOException {
String dbPath = tempFolder.newFolder().getAbsolutePath(); String dbPath = tempFolder.newFolder().getAbsolutePath();
Expand Down

0 comments on commit e13ac59

Please sign in to comment.