|
@@ -48,6 +48,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.UUID;
|
|
import java.util.UUID;
|
|
@@ -359,6 +360,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)));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -386,4 +388,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);
|
|
|
|
+ }
|
|
}
|
|
}
|