Skip to content

Commit 246fe2e

Browse files
committed
junit: Explain why configureAndInstallAgent is called in two places
1 parent 0f188c7 commit 246fe2e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main/java/com/code_intelligence/jazzer/junit/AgentConfiguringArgumentsProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext extensionCo
3737
// FIXME(fmeum): Calling this here feels like a hack. There should be a lifecycle hook that runs
3838
// before the argument discovery for a ParameterizedTest is kicked off, but I haven't found
3939
// one.
40+
// We need to call this method here in addition to the call in FuzzTestExtensions as our
41+
// ArgumentProviders need the bootstrap jar on the classpath and there may be no user-provided
42+
// ArgumentProviders to trigger the call in FuzzTestExtensions.
4043
FuzzTestExecutor.configureAndInstallAgent(
4144
extensionContext, fuzzTest.maxDuration(), fuzzTest.maxExecutions());
4245
return Stream.empty();

src/main/java/com/code_intelligence/jazzer/junit/FuzzTestExtensions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public void interceptTestTemplateMethod(Invocation<Void> invocation,
4444
throws Throwable {
4545
FuzzTest fuzzTest =
4646
AnnotationSupport.findAnnotation(invocationContext.getExecutable(), FuzzTest.class).get();
47+
// We need to call this method here in addition to the call in AgentConfiguringArgumentsProvider
48+
// as that provider isn't invoked before fuzz test executions for the arguments provided by
49+
// user-provided ArgumentsProviders ("Java seeds").
4750
FuzzTestExecutor.configureAndInstallAgent(
4851
extensionContext, fuzzTest.maxDuration(), fuzzTest.maxExecutions());
4952
// Skip the invocation of the test method with the special arguments provided by

0 commit comments

Comments
 (0)