|
@@ -493,7 +493,15 @@ public class TestHASafeMode {
|
|
|
private static void assertSafeMode(NameNode nn, int safe, int total,
|
|
|
int numNodes, int nodeThresh) {
|
|
|
String status = nn.getNamesystem().getSafemode();
|
|
|
- if (safe == total) {
|
|
|
+ if (total == 0 && nodeThresh == 0) {
|
|
|
+ assertTrue("Bad safemode status: '" + status + "'",
|
|
|
+ status.isEmpty()
|
|
|
+ || status.startsWith("Safe mode is ON. The reported blocks 0 " +
|
|
|
+ "has reached the threshold 0.9990 of total blocks 0. The " +
|
|
|
+ "minimum number of live datanodes is not required. In safe " +
|
|
|
+ "mode extension. Safe mode will be turned off automatically " +
|
|
|
+ "in 0 seconds."));
|
|
|
+ } else if (safe == total) {
|
|
|
if (nodeThresh == 0) {
|
|
|
assertTrue("Bad safemode status: '" + status + "'",
|
|
|
status.startsWith("Safe mode is ON. The reported blocks " + safe
|