Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-1222

Unit test failure in TestDefaultPolicyResourceMatcher (Java 8)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6.2
    • 0.7.0
    • None
    • None
    • Maven 3.3.9
      Open JDK 1.8

    Description

      I'm interested in getting Ranger to build on Windows.

      In the tests below the source was at the same level (current trunk), and maven 3.3.9 was used

      • Build ran run on a CentOS 7 (openjdk 1.7) system
      • Failure under Windows 10 anniversary (oracle jdk 1.8)
      • failure under win 10 "bash shell" (openjdk 1.8)

      In both failure cases the error was:

      Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec <<< FAILURE! - in org.apache.ranger.plugin.resourcematcher.TestDefaultPolicyResourceMatcher
      testDefaultPolicyResourceMatcher(org.apache.ranger.plugin.resourcematcher.TestDefaultPolicyResourceMatcher) Time elapsed: 0.002 sec <<< FAILURE!
      java.lang.AssertionError: match failed! :database=finance:MATCH for parent 'finance.tax.ssn':ancestorMatch: resource=RangerResourceImpl={ownerUser=

      {null}

      elements=

      {database=finance; table=tax; column=ssn; }

      } expected:<true> but was:<false>
      at org.junit.Assert.fail(Assert.java:88)
      at org.junit.Assert.failNotEquals(Assert.java:834)
      at org.junit.Assert.assertEquals(Assert.java:118)
      at org.apache.ranger.plugin.resourcematcher.TestDefaultPolicyResourceMatcher.runTest(TestDefaultPolicyResourceMatcher.java:129)
      at org.apache.ranger.plugin.resourcematcher.TestDefaultPolicyResourceMatcher.runTests(TestDefaultPolicyResourceMatcher.java:93)
      at org.apache.ranger.plugin.resourcematcher.TestDefaultPolicyResourceMatcher.runTestsFromResourceFiles(TestDefaultPolicyResourceMatcher.java:85)
      at org.apache.ranger.plugin.resourcematcher.TestDefaultPolicyResourceMatcher.testDefaultPolicyResourceMatcher(TestDefaultPolicyResourceMatcher.java:77)

      I then switched the one working environment to java 8 (openjdk 1.8 build 1.8.0_111-b15) and it then failed. Thus this is a java 8 incompatibility

      OpenJDK is support on RHEL until June 2018, though Oracle stopped shipping general java 1.7 public updates in June 2015

      Meanwhile Java 1.8 shipped originally in 2014 and is generally vendors preferred version (1.9 looks like mid 2017)

      I believe we need to resolve Java 1.8 incompatibilities and ensure Ranger works fully. (a subsequent step may be to drop support for 1.7, though there may be other dependencies esp within the hadoop environment for that to complete)

      Not investigated the fix yet.

      Attachments

        Activity

          People

            abhayk Abhay Kulkarni
            jonesn Nigel Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: