-
Notifications
You must be signed in to change notification settings - Fork 566
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Affected version
3.5.4
Bug description
Given the following class:
package test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.fail;
public class SomeTest {
@BeforeAll
public static void setUpClass() {
double r = Math.random();
if (r < 0.3) {
fail();
}
}
@Test
public void test1() {
}
}
It's failing randomly.
When success the file target/surefire-reports/TEST-test.SomeTest.xml contains the correct method name
<testcase name="test1" classname="test.SomeTest" time="0.01"/>
When failing there is no method name
<testcase name="" classname="test.SomeTest" time="0.043">
<failure type="org.opentest4j.AssertionFailedError at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java"><![CDATA[org.opentest4j.AssertionFailedError
at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:34)
at org.junit.jupiter.api.Assertions.fail(Assertions.java:116)
at test.SomeTest.setUpClass(SomeTest.java:38)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
stack trace simplified
]]></failure>
</testcase>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working