Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6685

Permission problems when running JUnit tests with Ant 1.9.4

    XMLWordPrintableJSON

    Details

      Description

      I saw many permission problems when I set up a build job for the 10.11 branch. See for example this log: https://builds.apache.org/job/Derby-10.11-suites.All/1/console

      First stack trace:

          [junit] Running org.apache.derby.PackagePrivateTestSuite
          [junit] Tests run: 67, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.662 sec
          [junit] Exception in thread "main" java.security.AccessControlException: access denied ("java.io.FilePermission" "/home/jenkins/jenkins-slave/workspace/Derby-10.11-suites.All/10.11-head/junit_20140804_1122/TEST-org.apache.derby.PackagePrivateTestSuite.xml" "write")
          [junit] 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
          [junit] 	at java.security.AccessController.checkPermission(AccessController.java:884)
          [junit] 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
          [junit] 	at java.lang.SecurityManager.checkWrite(SecurityManager.java:979)
          [junit] 	at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
          [junit] 	at java.io.FileOutputStream.<init>(FileOutputStream.java:156)
          [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.FormatterElement$DelayedFileOutputStream.write(FormatterElement.java:381)
          [junit] 	at java.io.OutputStream.write(OutputStream.java:116)
          [junit] 	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
          [junit] 	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
          [junit] 	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
          [junit] 	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
          [junit] 	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
          [junit] 	at java.io.BufferedWriter.flush(BufferedWriter.java:254)
          [junit] 	at org.apache.tools.ant.util.DOMElementWriter.openElement(DOMElementWriter.java:371)
          [junit] 	at org.apache.tools.ant.util.DOMElementWriter.write(DOMElementWriter.java:209)
          [junit] 	at org.apache.tools.ant.util.DOMElementWriter.write(DOMElementWriter.java:222)
          [junit] 	at org.apache.tools.ant.util.DOMElementWriter.write(DOMElementWriter.java:222)
          [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuite(XMLJUnitResultFormatter.java:188)
          [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite(JUnitTestRunner.java:840)
          [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:575)
          [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1179)
          [junit] 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1030)
          [junit] Running org.apache.derby.PackagePrivateTestSuite
          [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec
          [junit] Test org.apache.derby.PackagePrivateTestSuite FAILED (crashed)
      

      I can reproduce these failures in my environment by running the junit-single target with Ant 1.9.4. For example:

      ant -Dderby.junit.testclass=org.apache.derbyTesting.unitTests.junit.FormatableBitSetTest junit-single
      

      If I use an older Ant version (I've tried 1.9.0 and 1.8.2) it does not fail.

        Attachments

        1. d6685-1a.diff
          2 kB
          Knut Anders Hatlen

          Activity

            People

            • Assignee:
              knutanders Knut Anders Hatlen
              Reporter:
              knutanders Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: