Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14827

Allow StopWatch to accept a Timer parameter for tests

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-beta1, 2.8.3, 2.7.5
    • Component/s: common, test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      StopWatch should optionally accept a Timer parameter rather than directly using Time so that its behavior can be controlled during tests.

        Issue Links

          Activity

          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12811 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12811/)
          HADOOP-14827. Allow StopWatch to accept a Timer parameter for tests. (jlowe: rev dd814946f68d52a9b1627ac4dd61f9ab093423ae)

          • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StopWatch.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #12811 (See https://builds.apache.org/job/Hadoop-trunk-Commit/12811/ ) HADOOP-14827 . Allow StopWatch to accept a Timer parameter for tests. (jlowe: rev dd814946f68d52a9b1627ac4dd61f9ab093423ae) (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StopWatch.java
          Hide
          xkrogen Erik Krogen added a comment -

          Thank you very much Jason! Appreciate it.

          Show
          xkrogen Erik Krogen added a comment - Thank you very much Jason! Appreciate it.
          Hide
          jlowe Jason Lowe added a comment -

          I committed this to branch-2.8 and branch-2.7 as well.

          Show
          jlowe Jason Lowe added a comment - I committed this to branch-2.8 and branch-2.7 as well.
          Hide
          xkrogen Erik Krogen added a comment - - edited

          Jason Lowe thank you for the review and the commit! Any chance you would be willing to bring it to 2.7, 2.8? I am relying on this for the unit test in HDFS-12323 which I think is a severe enough bug that it needs to go to all of the release lines. It applies cleanly.

          Show
          xkrogen Erik Krogen added a comment - - edited Jason Lowe thank you for the review and the commit! Any chance you would be willing to bring it to 2.7, 2.8? I am relying on this for the unit test in HDFS-12323 which I think is a severe enough bug that it needs to go to all of the release lines. It applies cleanly.
          Hide
          jlowe Jason Lowe added a comment -

          Thanks to Erik Krogen for the contribution and to Hanisha Koneru for additional review! I committed this to trunk, branch-3.0, and branch-2.

          Show
          jlowe Jason Lowe added a comment - Thanks to Erik Krogen for the contribution and to Hanisha Koneru for additional review! I committed this to trunk, branch-3.0, and branch-2.
          Hide
          jlowe Jason Lowe added a comment -

          Thanks for the patch, Erik! Agree the unit test failures are unrelated. TestZKFailoverController and TestShellBasedUnixGroupsMapping pass for me locally with the patch applied.

          +1 for the patch. Committing this.

          Show
          jlowe Jason Lowe added a comment - Thanks for the patch, Erik! Agree the unit test failures are unrelated. TestZKFailoverController and TestShellBasedUnixGroupsMapping pass for me locally with the patch applied. +1 for the patch. Committing this.
          Hide
          hanishakoneru Hanisha Koneru added a comment -

          Thanks for the improvement, Erik Krogen.
          The patch LGTM. TestZKFailoverController and TestShellBasedUnixGroupsMapping pass locally for me too.
          +1 (non-binding).

          Show
          hanishakoneru Hanisha Koneru added a comment - Thanks for the improvement, Erik Krogen . The patch LGTM. TestZKFailoverController and TestShellBasedUnixGroupsMapping pass locally for me too. +1 (non-binding).
          Hide
          xkrogen Erik Krogen added a comment - - edited

          TestRaceWhenRelogin tracked at HADOOP-14078, TestLambdaTestUtils tracked at HADOOP-13882, TestDNS tracked at HADOOP-13101, TestKDiag tracked at HADOOP-14030. TestZKFailoverController and TestShellBasedUnixGroupsMapping I was unable to reproduce locally and do not look related.

          Show
          xkrogen Erik Krogen added a comment - - edited TestRaceWhenRelogin tracked at HADOOP-14078 , TestLambdaTestUtils tracked at HADOOP-13882 , TestDNS tracked at HADOOP-13101 , TestKDiag tracked at HADOOP-14030 . TestZKFailoverController and TestShellBasedUnixGroupsMapping I was unable to reproduce locally and do not look related.
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 17s Docker mode activated.
                Prechecks
          +1 @author 0m 0s The patch does not contain any @author tags.
          -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
                trunk Compile Tests
          +1 mvninstall 14m 40s trunk passed
          +1 compile 16m 46s trunk passed
          +1 checkstyle 0m 46s trunk passed
          +1 mvnsite 1m 21s trunk passed
          +1 findbugs 1m 52s trunk passed
          +1 javadoc 1m 4s trunk passed
                Patch Compile Tests
          +1 mvninstall 0m 48s the patch passed
          +1 compile 14m 7s the patch passed
          +1 javac 14m 7s the patch passed
          +1 checkstyle 0m 43s the patch passed
          +1 mvnsite 1m 20s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 58s the patch passed
          +1 javadoc 0m 57s the patch passed
                Other Tests
          -1 unit 10m 20s hadoop-common in the patch failed.
          +1 asflicense 0m 31s The patch does not generate ASF License warnings.
          69m 36s



          Reason Tests
          Failed junit tests hadoop.security.TestRaceWhenRelogin
            hadoop.test.TestLambdaTestUtils
            hadoop.security.TestShellBasedUnixGroupsMapping
            hadoop.ha.TestZKFailoverController
            hadoop.security.TestKDiag
            hadoop.net.TestDNS



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:71bbb86
          JIRA Issue HADOOP-14827
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12885011/HADOOP-14827.000.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux d60fb4dcf114 3.13.0-117-generic #164-Ubuntu SMP Fri Apr 7 11:05:26 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / c5281a8
          Default Java 1.8.0_144
          findbugs v3.1.0-RC1
          unit https://builds.apache.org/job/PreCommit-HADOOP-Build/13155/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt
          Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/13155/testReport/
          modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
          Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/13155/console
          Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 17s Docker mode activated.       Prechecks +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.       trunk Compile Tests +1 mvninstall 14m 40s trunk passed +1 compile 16m 46s trunk passed +1 checkstyle 0m 46s trunk passed +1 mvnsite 1m 21s trunk passed +1 findbugs 1m 52s trunk passed +1 javadoc 1m 4s trunk passed       Patch Compile Tests +1 mvninstall 0m 48s the patch passed +1 compile 14m 7s the patch passed +1 javac 14m 7s the patch passed +1 checkstyle 0m 43s the patch passed +1 mvnsite 1m 20s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 58s the patch passed +1 javadoc 0m 57s the patch passed       Other Tests -1 unit 10m 20s hadoop-common in the patch failed. +1 asflicense 0m 31s The patch does not generate ASF License warnings. 69m 36s Reason Tests Failed junit tests hadoop.security.TestRaceWhenRelogin   hadoop.test.TestLambdaTestUtils   hadoop.security.TestShellBasedUnixGroupsMapping   hadoop.ha.TestZKFailoverController   hadoop.security.TestKDiag   hadoop.net.TestDNS Subsystem Report/Notes Docker Image:yetus/hadoop:71bbb86 JIRA Issue HADOOP-14827 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12885011/HADOOP-14827.000.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux d60fb4dcf114 3.13.0-117-generic #164-Ubuntu SMP Fri Apr 7 11:05:26 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / c5281a8 Default Java 1.8.0_144 findbugs v3.1.0-RC1 unit https://builds.apache.org/job/PreCommit-HADOOP-Build/13155/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/13155/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/13155/console Powered by Apache Yetus 0.6.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          jojochuang Wei-Chiu Chuang added a comment -

          Haven't reviewed the patch, but I like the proposal. Thanks Erik.

          Show
          jojochuang Wei-Chiu Chuang added a comment - Haven't reviewed the patch, but I like the proposal. Thanks Erik.
          Hide
          xkrogen Erik Krogen added a comment -

          I particularly want this to be able to create a reliable unit test for HDFS-12323.

          Show
          xkrogen Erik Krogen added a comment - I particularly want this to be able to create a reliable unit test for HDFS-12323 .

            People

            • Assignee:
              xkrogen Erik Krogen
              Reporter:
              xkrogen Erik Krogen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development