HDFS-9300. TestDirectoryScanner.testThrottle() is still a little flakey. Contributed by Daniel Templeton.

This commit is contained in:
Andrew Wang 2015-12-16 16:21:06 -08:00
parent d4e766de93
commit 3c0adac88c
2 changed files with 5 additions and 2 deletions

View File

@ -901,6 +901,9 @@ Release 2.9.0 - UNRELEASED
HDFS-9371. Code cleanup for DatanodeManager. (jing9)
HDFS-9300. TestDirectoryScanner.testThrottle() is still a little flakey.
(Daniel Templeton via wang)
OPTIMIZATIONS
BUG FIXES

View File

@ -601,7 +601,7 @@ public void testThrottling() throws Exception {
ratio = 0.0f;
retries = maxRetries;
while ((retries > 0) && ((ratio < 3f) || (ratio > 4.5f))) {
while ((retries > 0) && ((ratio < 2.75f) || (ratio > 4.5f))) {
scanner = new DirectoryScanner(dataNode, fds, conf);
ratio = runThrottleTest(blocks);
retries -= 1;
@ -610,7 +610,7 @@ public void testThrottling() throws Exception {
// Waiting should be about 4x running.
LOG.info("RATIO: " + ratio);
assertTrue("Throttle is too restrictive", ratio <= 4.5f);
assertTrue("Throttle is too permissive", ratio >= 3.0f);
assertTrue("Throttle is too permissive", ratio >= 2.75f);
// Test with more than 1 thread
conf.setInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_THREADS_KEY, 3);