Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-19147 All branch-2 unit tests pass
  3. HBASE-19862

Fix TestTokenAuthentication - fake RegionCoprocessorEnvironment is not of type HasRegionServerServices

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-beta-2, 2.0.0
    • None
    • None

    Description

      We have temporary HasRegionServerServices (added in HBASE-19007) and concept of CoreCoprocessors which require that whichever *CoprocessorEnvironment they get, it should also implement HasRegionServerServices.
      This test builds mock RegionCpEnv for TokenProvider (RegionCoprocessor), but it falls short of what's expected and results in following exceptions in test logs

      2018-01-25 14:38:54,855 ERROR [TokenServer:d9a9782cd075,39492,1516891133911] helpers.MarkerIgnoringBase(159): Aborting on: org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer$2 cannot be cast to org.apache.hadoop.hbase.coprocessor.HasRegionServerServices
      java.lang.ClassCastException: org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer$2 cannot be cast to org.apache.hadoop.hbase.coprocessor.HasRegionServerServices
      	at org.apache.hadoop.hbase.security.token.TokenProvider.start(TokenProvider.java:70)
      	at org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer.initialize(TestTokenAuthentication.java:275)
      	at org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer.run(TestTokenAuthentication.java:347)
      

      Patch adds the missing interface to the mock. Also, uses Mockito to mock the interfaces rather the crude way.

      Attachments

        1. HBASE-19862.branch-2.001.patch
          8 kB
          Apekshit Sharma

        Issue Links

          Activity

            Ping stack.

            appy Apekshit Sharma added a comment - Ping stack .
            hadoopqa Hadoop QA added a comment -
            -1 overall



            Vote Subsystem Runtime Comment
            0 reexec 0m 13s Docker mode activated.
                  Prechecks
            0 findbugs 0m 0s Findbugs executables are not available.
            +1 hbaseanti 0m 0s Patch does not have any anti-patterns.
            +1 @author 0m 0s The patch does not contain any @author tags.
            +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
                  branch-2 Compile Tests
            +1 mvninstall 4m 21s branch-2 passed
            +1 compile 0m 55s branch-2 passed
            +1 checkstyle 1m 13s branch-2 passed
            +1 shadedjars 5m 54s branch has no errors when building our shaded downstream artifacts.
            +1 javadoc 0m 36s branch-2 passed
                  Patch Compile Tests
            +1 mvninstall 3m 44s the patch passed
            +1 compile 0m 48s the patch passed
            +1 javac 0m 48s the patch passed
            -1 checkstyle 1m 9s hbase-server: The patch generated 29 new + 4 unchanged - 9 fixed = 33 total (was 13)
            +1 whitespace 0m 0s The patch has no whitespace issues.
            +1 shadedjars 4m 21s patch has no errors when building our shaded downstream artifacts.
            +1 hadoopcheck 16m 50s Patch does not cause any errors with Hadoop 2.6.5 2.7.4 or 3.0.0.
            +1 javadoc 0m 34s the patch passed
                  Other Tests
            -1 unit 104m 43s hbase-server in the patch failed.
            +1 asflicense 0m 19s The patch does not generate ASF License warnings.
            140m 20s



            Reason Tests
            Failed junit tests hadoop.hbase.TestJMXListener



            Subsystem Report/Notes
            Docker Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hbase:9f2f2db
            JIRA Issue HBASE-19862
            JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12907774/HBASE-19862.branch-2.001.patch
            Optional Tests asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
            uname Linux 3baa0f25b0c8 3.13.0-139-generic #188-Ubuntu SMP Tue Jan 9 14:43:09 UTC 2018 x86_64 GNU/Linux
            Build tool maven
            Personality /home/jenkins/jenkins-slave/workspace/PreCommit-HBASE-Build@2/component/dev-support/hbase-personality.sh
            git revision branch-2 / 72f4e98ed1
            maven version: Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
            Default Java 1.8.0_151
            checkstyle https://builds.apache.org/job/PreCommit-HBASE-Build/11198/artifact/patchprocess/diff-checkstyle-hbase-server.txt
            unit https://builds.apache.org/job/PreCommit-HBASE-Build/11198/artifact/patchprocess/patch-unit-hbase-server.txt
            Test Results https://builds.apache.org/job/PreCommit-HBASE-Build/11198/testReport/
            modules C: hbase-server U: hbase-server
            Console output https://builds.apache.org/job/PreCommit-HBASE-Build/11198/console
            Powered by Apache Yetus 0.6.0 http://yetus.apache.org

            This message was automatically generated.

            hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 13s Docker mode activated.       Prechecks 0 findbugs 0m 0s Findbugs executables are not available. +1 hbaseanti 0m 0s Patch does not have any anti-patterns. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.       branch-2 Compile Tests +1 mvninstall 4m 21s branch-2 passed +1 compile 0m 55s branch-2 passed +1 checkstyle 1m 13s branch-2 passed +1 shadedjars 5m 54s branch has no errors when building our shaded downstream artifacts. +1 javadoc 0m 36s branch-2 passed       Patch Compile Tests +1 mvninstall 3m 44s the patch passed +1 compile 0m 48s the patch passed +1 javac 0m 48s the patch passed -1 checkstyle 1m 9s hbase-server: The patch generated 29 new + 4 unchanged - 9 fixed = 33 total (was 13) +1 whitespace 0m 0s The patch has no whitespace issues. +1 shadedjars 4m 21s patch has no errors when building our shaded downstream artifacts. +1 hadoopcheck 16m 50s Patch does not cause any errors with Hadoop 2.6.5 2.7.4 or 3.0.0. +1 javadoc 0m 34s the patch passed       Other Tests -1 unit 104m 43s hbase-server in the patch failed. +1 asflicense 0m 19s The patch does not generate ASF License warnings. 140m 20s Reason Tests Failed junit tests hadoop.hbase.TestJMXListener Subsystem Report/Notes Docker Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hbase:9f2f2db JIRA Issue HBASE-19862 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12907774/HBASE-19862.branch-2.001.patch Optional Tests asflicense javac javadoc unit findbugs shadedjars hadoopcheck hbaseanti checkstyle compile uname Linux 3baa0f25b0c8 3.13.0-139-generic #188-Ubuntu SMP Tue Jan 9 14:43:09 UTC 2018 x86_64 GNU/Linux Build tool maven Personality /home/jenkins/jenkins-slave/workspace/PreCommit-HBASE-Build@2/component/dev-support/hbase-personality.sh git revision branch-2 / 72f4e98ed1 maven version: Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z) Default Java 1.8.0_151 checkstyle https://builds.apache.org/job/PreCommit-HBASE-Build/11198/artifact/patchprocess/diff-checkstyle-hbase-server.txt unit https://builds.apache.org/job/PreCommit-HBASE-Build/11198/artifact/patchprocess/patch-unit-hbase-server.txt Test Results https://builds.apache.org/job/PreCommit-HBASE-Build/11198/testReport/ modules C: hbase-server U: hbase-server Console output https://builds.apache.org/job/PreCommit-HBASE-Build/11198/console Powered by Apache Yetus 0.6.0 http://yetus.apache.org This message was automatically generated.

            Will cleanup checkstyles on commit.
            Ping zghaobac since you reviewed the related change too.

            appy Apekshit Sharma added a comment - Will cleanup checkstyles on commit. Ping zghaobac since you reviewed the related change too.
            zhangduo Duo Zhang added a comment -

            +1. This will be pushed to both master and branch-2 right?

            zhangduo Duo Zhang added a comment - +1. This will be pushed to both master and branch-2 right?

            Pushed to master and branch-2.
            Forgot to make checkstyle changes in initial commit, so made an addendum and pushed it.
            Also added Timeout Rule so that the test obeys our category based timeout rules.
            Thanks for the review Apache9.

            appy Apekshit Sharma added a comment - Pushed to master and branch-2. Forgot to make checkstyle changes in initial commit, so made an addendum and pushed it. Also added Timeout Rule so that the test obeys our category based timeout rules. Thanks for the review Apache9 .
            hudson Hudson added a comment -

            FAILURE: Integrated in Jenkins build HBase-Trunk_matrix #4471 (See https://builds.apache.org/job/HBase-Trunk_matrix/4471/)
            HBASE-19862 Fix TestTokenAuthentication - mock (appy: rev 61358985b15164cbcdc6e58005208c0906c3830a)

            • (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java
              HBASE-19862 addendum: Checkstyle fixes, remove unused imports and (appy: rev 1beb687f4e489dff352a746d4544ff1a0a1ed829)
            • (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java
            hudson Hudson added a comment - FAILURE: Integrated in Jenkins build HBase-Trunk_matrix #4471 (See https://builds.apache.org/job/HBase-Trunk_matrix/4471/ ) HBASE-19862 Fix TestTokenAuthentication - mock (appy: rev 61358985b15164cbcdc6e58005208c0906c3830a) (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java HBASE-19862 addendum: Checkstyle fixes, remove unused imports and (appy: rev 1beb687f4e489dff352a746d4544ff1a0a1ed829) (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/security/token/TestTokenAuthentication.java

            People

              appy Apekshit Sharma
              appy Apekshit Sharma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: