浏览代码

HDFS-2044. TestQueueProcessingStatistics failing automatic test due to timing issues (mattf)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security@1133135 13f79535-47bb-0310-9956-ffa450edef68
Matthew Foley 14 年之前
父节点
当前提交
ce4152b129
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 3 0
      CHANGES.txt
  2. 8 0
      src/test/org/apache/hadoop/util/TestQueueProcessingStatistics.java

+ 3 - 0
CHANGES.txt

@@ -64,6 +64,9 @@ Release 0.20.205.0 - unreleased
     MAPREDUCE-2529. Add support for regex-based shuffle metric counting
     MAPREDUCE-2529. Add support for regex-based shuffle metric counting
     exceptions. (Thomas Graves via cdouglas)
     exceptions. (Thomas Graves via cdouglas)
 
 
+    HDFS-2044. TestQueueProcessingStatistics failing automatic test due to 
+    timing issues. (mattf)
+
 Release 0.20.204.0 - unreleased
 Release 0.20.204.0 - unreleased
 
 
   NEW FEATURES
   NEW FEATURES

+ 8 - 0
src/test/org/apache/hadoop/util/TestQueueProcessingStatistics.java

@@ -89,6 +89,13 @@ public class TestQueueProcessingStatistics extends junit.framework.TestCase {
     //Asserts based on general principles
     //Asserts based on general principles
     assertTrue(failMsg(), qStats.startTime >= 0);
     assertTrue(failMsg(), qStats.startTime >= 0);
     if (qStats.state != State.BEGIN_COLLECTING) {
     if (qStats.state != State.BEGIN_COLLECTING) {
+      /* The following timing calculations don't work in many 
+       * automated test environments (e.g., on heavily loaded servers with
+       * very unreliable "sleep()" durations), but are useful during 
+       * development work.  Commenting them out but leaving them here 
+       * for dev use.
+       */
+      /*
       assertAlmostEquals(failMsg() + " inCycle=" + inCycle, 
       assertAlmostEquals(failMsg() + " inCycle=" + inCycle, 
           qStats.startTimeCurrentCycle, 
           qStats.startTimeCurrentCycle, 
           qStats.startTime 
           qStats.startTime 
@@ -100,6 +107,7 @@ public class TestQueueProcessingStatistics extends junit.framework.TestCase {
           qStats.clockDuration, 
           qStats.clockDuration, 
           qStats.processDuration 
           qStats.processDuration 
           + cycleDelay * (qStats.cycleCount - (qStats.cycleCount > 0 ? 1 : 0)));
           + cycleDelay * (qStats.cycleCount - (qStats.cycleCount > 0 ? 1 : 0)));
+       */
     }
     }
     assertTrue(failMsg(), qStats.workItemCount >= 0);
     assertTrue(failMsg(), qStats.workItemCount >= 0);
     assertTrue(failMsg(), qStats.cycleCount >= 0);
     assertTrue(failMsg(), qStats.cycleCount >= 0);