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

(cherry picked from commit 3c0adac88c3cddb821a732aea02bc068cafd7ea8)
This commit is contained in:
Eric Payne 2017-02-02 15:34:59 -05:00
parent 4f135647fd
commit 4e423edd95

View File

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