-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
junit: Compute a default for jazzer.instrument
based on the class path
#732
junit: Compute a default for jazzer.instrument
based on the class path
#732
Conversation
@florianGla Could you test whether this works for |
I replaced jazzer-junit in my local maven repository, but I does not make any difference. I probably did something wrong though. |
@florianGla Could you provide the verbose output of |
🔍 Command: NO_CIFUZZ='1' JAVA_HOME='/usr/lib/jvm/java-17-openjdk-amd64' RULES_JNI_TRACE='1' "/usr/lib/jvm/java-17-openjdk-amd64/bin/java" "-cp" "/home/flogla/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.9.2/junit-jupiter-engine-5.9.2.jar:/home/flogla/.m2/repository/org/junit/platform/junit-platform-engine/1.9.2/junit-platform-engine-1.9.2.jar:/home/flogla/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-.2.0.jar:/home/flogla/.m2/repository/org/junit/platform/junit-platform-commons/1.9.2/junit-platform-commons-1.9.2.jar:/home/flogla/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.9.2/junit-jupiter-api-5.9.2.jar:/home/flogla/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/home/flogla/.m2/repository/com/code-intelligence/jazzer-junit/0.16.0/jazzer-ju I have replaced this jar with your version: /home/flogla/.m2/repository/com/code-intelligence/jazzer-junit/0.16.0/jazzer-ju |
@florianGla Could you print the content of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@florianGla based on your logs you're using version |
Unfortunately I get the same outputs. It is strange that the instrumentation includes are set, but seem to have no effect. |
@florianGla I found a bug that caused both the old and the new heuristic to not affect the scope of instrumentation when running within cifuzz - I will submit a fix. |
@florianGla I pushed a fix, could you test this again? |
Unfortunately it does not seem to be fixed. |
@florianGla This was broken in yet another way. I added a full end-to-end test, so this should be the last time I ask you to try it out. Fingers crossed ;-) |
It still does not seem to work. Maybe we can have a look together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. The failing test also works locally and don't seem to be flaky. Restarted it.
The test is flaky, but with an interesting failure:
I will submit a separate fix. @florianGla Yes, let's look into it together next week. |
Rebased onto #748 |
This reverts commit 4dfee6d and adds a comment explaining why it wasn't a good idea.
The `Driver` accesses `Opt` settings and thus locked in their values before the JUnit integration, specifically `AgentConfigurator`, had a chance to update the instrumentation filter. This is worked around by evaluating the instrumentation settings lazily, with a more conceptual fix coming with the ongoing config overhaul.
The new heuristic walks the classpath directory and considers all directories (but not jar files) to constitute the classes of the current project. All subdirectories that include `.class` files are translated into packages and all their subpackages are subject to instrumentation. This is expected to give much better results than the previous heuristic, which only considered the first two or three segments of the test class package.
@florianGla I tested this on the cifuzz Maven example and the instrumentation filter is effective now. |
The new heuristic walks the classpath directory and considers all directories (but not jar files) to constitute the classes of the current project. All subdirectories that include
.class
files are translated into packages and all their subpackages are subject to instrumentation.This is expected to give much better results than the previous heuristic, which only considered the first two or three segments of the test class package.