You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please understand that
ISSUES WITHOUT FOLLOWING INFORMATION WILL BE CLOSED WITHOUT COMMENTS!
Thank you for filing a useful bug report!
Steps to reproduce
JaCoCo version: 0.8.12
Operating system:
Tool integration: Ant
Complete executable reproducer: TBD
Steps: TBD
Unit tests that interrupt threads as part of the setup, prior to accessing classes under test, cause JaCoCo 0.8.12 to crash while loading the class. This was not an issue with earlier JaCoCo 0.7 versions.
A workaround in the tests themselves is to access the class under test prior to interrupting the thread so that JaCoCo can initialize before the thread is interrupted.
@Test(expected=InterruptedException.class) {
Thread.currentThread().interrupt();
Foo.sleep(1);
}
public static class Foo {
public static void sleep(final long millis) throws InterruptedException
{
TimeUnit.MILLISECONDS.sleep(millis);
}
}
Expected behaviour
Unit tests that pass without JaCoCo also pass with JaCoCo.
Actual behaviour
[junit] Testsuite: com.example.DemoInterruptionFailure
[junit] java.nio.channels.FileLockInterruptionException
[junit] at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1091)
[junit] at java.nio.channels.FileChannel.lock(FileChannel.java:1053)
[junit] at org.jacoco.agent.rt.internal_aeaf9ab.output.FileOutput.openFile(FileOutput.java:83)
[junit] at org.jacoco.agent.rt.internal_aeaf9ab.output.FileOutput.startup(FileOutput.java:57)
[junit] at org.jacoco.agent.rt.internal_aeaf9ab.Agent.startup(Agent.java:129)
[junit] at org.jacoco.agent.rt.internal_aeaf9ab.Agent.getInstance(Agent.java:54)
[junit] at org.jacoco.agent.rt.internal_aeaf9ab.Offline.getRuntimeData(Offline.java:39)
[junit] at org.jacoco.agent.rt.internal_aeaf9ab.Offline.getProbes(Offline.java:60)
[junit] at com.example.Foo.<clinit>(Foo.java)
[junit] at com.example.FooTest$1.run(FooTest.java:48)
The text was updated successfully, but these errors were encountered:
asheldon
changed the title
JaCoCo 0.8.12 crashes when running tests that interrupt the thread
JaCoCo 0.8.12 crashes when running tests that pre-interrupt the thread
Jan 12, 2025
THIS IS A BUG TRACKER ONLY. FOR QUESTIONS PLEASE CHECK FAQ OR USE FORUM:
http://www.jacoco.org/jacoco/trunk/doc/faq.html
https://groups.google.com/forum/?fromgroups=#!forum/jacoco
Please understand that
ISSUES WITHOUT FOLLOWING INFORMATION WILL BE CLOSED WITHOUT COMMENTS!
Thank you for filing a useful bug report!
Steps to reproduce
Unit tests that interrupt threads as part of the setup, prior to accessing classes under test, cause JaCoCo 0.8.12 to crash while loading the class. This was not an issue with earlier JaCoCo 0.7 versions.
A workaround in the tests themselves is to access the class under test prior to interrupting the thread so that JaCoCo can initialize before the thread is interrupted.
Expected behaviour
Unit tests that pass without JaCoCo also pass with JaCoCo.
Actual behaviour
The text was updated successfully, but these errors were encountered: