HDFS-10921. TestDiskspaceQuotaUpdate doesn't wait for NN to get out of safe mode. Contributed by Eric Badger
(cherry picked from commit 55e1fb8e32
)
This commit is contained in:
parent
9a98feb769
commit
a7684f6517
|
@ -52,6 +52,7 @@ import org.apache.hadoop.test.GenericTestUtils;
|
||||||
import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
|
import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
|
@ -76,6 +77,18 @@ public class TestDiskspaceQuotaUpdate {
|
||||||
cluster.waitActive();
|
cluster.waitActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void resetCluster() throws Exception {
|
||||||
|
if (!cluster.isClusterUp()) {
|
||||||
|
// Previous test seems to have left cluster in a bad state;
|
||||||
|
// recreate the cluster to protect subsequent tests
|
||||||
|
cluster.shutdown();
|
||||||
|
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(REPLICATION)
|
||||||
|
.build();
|
||||||
|
cluster.waitActive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void tearDown() throws Exception {
|
public static void tearDown() throws Exception {
|
||||||
if (cluster != null) {
|
if (cluster != null) {
|
||||||
|
@ -254,7 +267,7 @@ public class TestDiskspaceQuotaUpdate {
|
||||||
assertEquals(spaceUsed, newSpaceUsed);
|
assertEquals(spaceUsed, newSpaceUsed);
|
||||||
// make sure edits aren't corrupted
|
// make sure edits aren't corrupted
|
||||||
getDFS().recoverLease(file);
|
getDFS().recoverLease(file);
|
||||||
cluster.restartNameNodes();
|
cluster.restartNameNode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -297,7 +310,7 @@ public class TestDiskspaceQuotaUpdate {
|
||||||
assertEquals(spaceUsed, newSpaceUsed);
|
assertEquals(spaceUsed, newSpaceUsed);
|
||||||
// make sure edits aren't corrupted
|
// make sure edits aren't corrupted
|
||||||
getDFS().recoverLease(file);
|
getDFS().recoverLease(file);
|
||||||
cluster.restartNameNodes();
|
cluster.restartNameNode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -337,7 +350,7 @@ public class TestDiskspaceQuotaUpdate {
|
||||||
assertEquals(spaceUsed, newSpaceUsed);
|
assertEquals(spaceUsed, newSpaceUsed);
|
||||||
// make sure edits aren't corrupted
|
// make sure edits aren't corrupted
|
||||||
getDFS().recoverLease(file);
|
getDFS().recoverLease(file);
|
||||||
cluster.restartNameNodes();
|
cluster.restartNameNode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue