HDFS-9743. Fix TestLazyPersistFiles#testFallbackToDiskFull in branch-2.7. Contributed by Kihwal Lee.

This commit is contained in:
Kihwal Lee 2016-02-03 12:51:01 -06:00
parent 5131ee56a6
commit dd11c8274d
2 changed files with 9 additions and 0 deletions

View File

@ -81,6 +81,8 @@ Release 2.7.3 - UNRELEASED
HDFS-9406. FSImage may get corrupted after deleting snapshot. HDFS-9406. FSImage may get corrupted after deleting snapshot.
(Contributed by Jing Zhao, Stanislav Antic, Vinayakumar B, Yongjun Zhang) (Contributed by Jing Zhao, Stanislav Antic, Vinayakumar B, Yongjun Zhang)
HDFS-9743. Fix TestLazyPersistFiles#testFallbackToDiskFull (kihwal)
HDFS-9740. Use a reasonable limit in DFSTestUtil.waitForMetric() HDFS-9740. Use a reasonable limit in DFSTestUtil.waitForMetric()
(Chang Li via vinayakumarb) (Chang Li via vinayakumarb)

View File

@ -47,6 +47,7 @@ import org.junit.rules.Timeout;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.TimeoutException;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.HashSet; import java.util.HashSet;
@ -401,6 +402,7 @@ public abstract class LazyPersistTestCase {
protected final void verifyRamDiskJMXMetric(String metricName, protected final void verifyRamDiskJMXMetric(String metricName,
long expectedValue) throws Exception { long expectedValue) throws Exception {
waitForMetric(metricName, (int)expectedValue);
assertEquals(expectedValue, Integer.parseInt(jmx.getValue(metricName))); assertEquals(expectedValue, Integer.parseInt(jmx.getValue(metricName)));
} }
@ -428,4 +430,9 @@ public abstract class LazyPersistTestCase {
e.printStackTrace(); e.printStackTrace();
} }
} }
protected void waitForMetric(final String metricName, final int expectedValue)
throws TimeoutException, InterruptedException {
DFSTestUtil.waitForMetric(jmx, metricName, expectedValue);
}
} }