Version
- jazzer-junit: 0.30.0
- IntelliJ IDEA 2026.1.4
Description
Follow-up for #930
Jazzer uses JUnit's @Timeout annotation to set its own fuzzing timeout, and is then supposed to suppress JUnit's own timeout handling:
|
// JUnit's timeout handling interferes with libFuzzer as from the point of view of JUnit |
|
// all fuzz test invocations are combined in a single JUnit test method execution. |
|
// https://junit.org/junit5/docs/current/user-guide/#writing-tests-declarative-timeouts-mode |
|
.configurationParameter("junit.jupiter.execution.timeout.mode", timeoutMode) |
However, when running JUnit tests directly from the IDE (IntelliJ IDEA), it seems this code is not executed and JUnit's timeout handling is not suppressed. So even though fuzzing succeeds, JUnit might erroneously report a timeout failure at the end if the total time of all executions 'exceeded' the timeout.
Reproduction steps
Create a dummy fuzzing test:
import com.code_intelligence.jazzer.junit.FuzzTest;
import org.junit.jupiter.api.Timeout;
import java.util.concurrent.TimeUnit;
public class TimeoutTest {
@Timeout(value = 3, unit = TimeUnit.SECONDS)
@FuzzTest(maxDuration = "5s")
void test(byte[] bytes) {
}
}
Then run the test from within the IDE, and edit the run configuration to set the environment variable JAZZER_FUZZ=1.
❌ Bug: Fuzzing succeeds, but the execution fails at the end: "TimeoutException: test([B) timed out after 3 seconds"
Version
Description
Follow-up for #930
Jazzer uses JUnit's
@Timeoutannotation to set its own fuzzing timeout, and is then supposed to suppress JUnit's own timeout handling:jazzer/src/main/java/com/code_intelligence/jazzer/driver/junit/JUnitRunner.java
Lines 110 to 113 in 50a0e8f
However, when running JUnit tests directly from the IDE (IntelliJ IDEA), it seems this code is not executed and JUnit's timeout handling is not suppressed. So even though fuzzing succeeds, JUnit might erroneously report a timeout failure at the end if the total time of all executions 'exceeded' the timeout.
Reproduction steps
Create a dummy fuzzing test:
Then run the test from within the IDE, and edit the run configuration to set the environment variable
JAZZER_FUZZ=1.❌ Bug: Fuzzing succeeds, but the execution fails at the end: "TimeoutException: test([B) timed out after 3 seconds"