glassfish
  1. glassfish
  2. GLASSFISH-20664

grizzly-config unit tests can fail if the tests were previously ran with another user

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1
    • Component/s: grizzly-kernel
    • Labels:
      None

      Description

      java.lang.AssertionError: /var/tmp/grizzly-config-test0/index.html (Permission denied)
      	at org.junit.Assert.fail(Assert.java:93)
      	at org.glassfish.grizzly.config.BaseTestGrizzlyConfig.addStaticHttpHandler(BaseTestGrizzlyConfig.java:108)
      	at org.glassfish.grizzly.config.GrizzlyConfigTest.ssl(GrizzlyConfigTest.java:251)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
      	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
      	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:165)
      	at org.apache.maven.surefire.Surefire.run(Surefire.java:107)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:289)
      	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1005)
      

      I'm not 100% sure, but it seems that the test tried to reuse a file that was created by a previous run with another user.
      However the test fails because the file is read-only.

      Would it be possible to improve the test to test if the file is writable first ? Or maybe fall back to use target/ folder instead of tmp ?

      Let me know what you think.

        Activity

        Hide
        oleksiys added a comment -

        the fix is commited, let me know if it helped.

        Show
        oleksiys added a comment - the fix is commited, let me know if it helped.
        Hide
        oleksiys added a comment -

        fixed

        Show
        oleksiys added a comment - fixed

          People

          • Assignee:
            oleksiys
            Reporter:
            Romain Grécourt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: