You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2014/09/15 13:59:33 UTC

[jira] [Commented] (DERBY-6736) The jacoco-junit target fails to store coverage data for some sub-suites

    [ https://issues.apache.org/jira/browse/DERBY-6736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133820#comment-14133820 ] 

Knut Anders Hatlen commented on DERBY-6736:
-------------------------------------------

Common for the suites that _don't_ fail, seems to be that the last test in each of those suites runs with a custom security policy. Since SecurityManagerSetup.tearDown() uninstalls the security manager after these tests, there is no security manager installed when the JVM shutdown hook runs. The coverage data are written to disk from the JVM shutdown hook.

In tests that don't use a custom security policy, the security manager is not uninstalled when the test is torn down. Therefore, in test suites that end with a test that uses the default security policy, the JVM shutdown hook runs with the default test policy. Presumably, the default policy lacks the permission needed to write the coverage data to a file.

> The jacoco-junit target fails to store coverage data for some sub-suites
> ------------------------------------------------------------------------
>
>                 Key: DERBY-6736
>                 URL: https://issues.apache.org/jira/browse/DERBY-6736
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.12.0.0
>            Reporter: Knut Anders Hatlen
>
> The console log for the code coverage test runs at https://builds.apache.org/job/Derby-JaCoCo/ shows that JaCoCo fails to write coverage data for the following test suites:
> lang
> jdbcapi
> store
> engine
> encryption
> It is caused by the following permissions-related exception:
> {noformat}
>     [junit] java.security.AccessControlException: access denied ("java.io.FilePermission" "/home/jenkins/jenkins-slave/workspace/Derby-JaCoCo/trunk/junit_20140912_1758/jacoco.exec" "write")
>     [junit] 	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
>     [junit] 	at java.security.AccessController.checkPermission(AccessController.java:559)
>     [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:203)
>     [junit] 	at org.jacoco.agent.rt.internal_9dd1198.output.FileOutput.openFile(FileOutput.java:67)
>     [junit] 	at org.jacoco.agent.rt.internal_9dd1198.output.FileOutput.writeExecutionData(FileOutput.java:53)
>     [junit] 	at org.jacoco.agent.rt.internal_9dd1198.Agent.shutdown(Agent.java:143)
>     [junit] 	at org.jacoco.agent.rt.internal_9dd1198.Agent$1.run(Agent.java:60)
> {noformat}
> The result of this is that the coverage report shows lower coverage than what's actually covered by the tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)