HDFS-8309. Skip unit test using DataNodeTestUtils#injectDataDirFailure() on Windows. (xyao)

This commit is contained in:
Xiaoyu Yao 2015-05-02 22:15:24 -07:00
parent e8d0ee5fc9
commit a319771d1d
4 changed files with 18 additions and 8 deletions

View File

@ -607,6 +607,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8229. LAZY_PERSIST file gets deleted after NameNode restart. HDFS-8229. LAZY_PERSIST file gets deleted after NameNode restart.
(Surendra Singh Lilhore via Arpit Agarwal) (Surendra Singh Lilhore via Arpit Agarwal)
HDFS-8309. Skip unit test using DataNodeTestUtils#injectDataDirFailure() on Windows.
(xyao)
Release 2.7.1 - UNRELEASED Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -78,6 +78,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import static org.mockito.Matchers.any; import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doAnswer;
@ -705,6 +706,10 @@ public class TestDataNodeHotSwapVolumes {
public void testDirectlyReloadAfterCheckDiskError() public void testDirectlyReloadAfterCheckDiskError()
throws IOException, TimeoutException, InterruptedException, throws IOException, TimeoutException, InterruptedException,
ReconfigurationException { ReconfigurationException {
// The test uses DataNodeTestUtils#injectDataDirFailure() to simulate
// volume failures which is currently not supported on Windows.
assumeTrue(!Path.WINDOWS);
startDFSCluster(1, 2); startDFSCluster(1, 2);
createFile(new Path("/test"), 32, (short)2); createFile(new Path("/test"), 32, (short)2);

View File

@ -207,8 +207,12 @@ public class TestDataNodeVolumeFailure {
* after failure. * after failure.
*/ */
@Test(timeout=150000) @Test(timeout=150000)
public void testFailedVolumeBeingRemovedFromDataNode() public void testFailedVolumeBeingRemovedFromDataNode()
throws InterruptedException, IOException, TimeoutException { throws InterruptedException, IOException, TimeoutException {
// The test uses DataNodeTestUtils#injectDataDirFailure() to simulate
// volume failures which is currently not supported on Windows.
assumeTrue(!Path.WINDOWS);
Path file1 = new Path("/test1"); Path file1 = new Path("/test1");
DFSTestUtil.createFile(fs, file1, 1024, (short) 2, 1L); DFSTestUtil.createFile(fs, file1, 1024, (short) 2, 1L);
DFSTestUtil.waitReplication(fs, file1, (short) 2); DFSTestUtil.waitReplication(fs, file1, (short) 2);
@ -270,9 +274,8 @@ public class TestDataNodeVolumeFailure {
*/ */
@Test @Test
public void testUnderReplicationAfterVolFailure() throws Exception { public void testUnderReplicationAfterVolFailure() throws Exception {
// This test relies on denying access to data volumes to simulate data volume // The test uses DataNodeTestUtils#injectDataDirFailure() to simulate
// failure. This doesn't work on Windows, because an owner of an object // volume failures which is currently not supported on Windows.
// always has the ability to read and change permissions on the object.
assumeTrue(!Path.WINDOWS); assumeTrue(!Path.WINDOWS);
// Bring up one more datanode // Bring up one more datanode

View File

@ -76,9 +76,8 @@ public class TestDataNodeVolumeFailureReporting {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
// These tests simulate volume failures by denying execute permission on the // These tests use DataNodeTestUtils#injectDataDirFailure() to simulate
// volume's path. On Windows, the owner of an object is always allowed // volume failures which is currently not supported on Windows.
// access, so we can't run these tests on Windows.
assumeTrue(!Path.WINDOWS); assumeTrue(!Path.WINDOWS);
// Allow a single volume failure (there are two volumes) // Allow a single volume failure (there are two volumes)
initCluster(1, 2, 1); initCluster(1, 2, 1);