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
In Project view find utbot-sample/src/main/java/org/utbot/examples/exceptions/JvmCrashExamples.java
Generate tests with UnitTestBot...
Check there are tests "Disabled due to possible JVM crash" and "Disabled due to sandbox"
Expected behavior
These found problems need to:
add to error suite
add to SARIF-report
display on Problems tab with the respectful stack trace
Actual behavior
Currently executions that are stopped on AccessControlException - Disabled due to sandbox - are not added to SARIF report as errors and are not displayed on Problems tab.
Same with the tests "Disabled due to possible JVM crash".
Visual proofs (screenshots, logs, images)
publicclassJvmCrashExamplesTest {
///region Test suites for executable org.utbot.examples.exceptions.JvmCrashExamples.crash///region OTHER: SECURITY for method crash(int)@Test@org.junit.Ignore(value = "Disabled due to sandbox")
publicvoidtestCrash1() {
JvmCrashExamplesjvmCrashExamples = newJvmCrashExamples();
/* This test fails because method [org.utbot.examples.exceptions.JvmCrashExamples.crash] produces [java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")] java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) java.base/java.security.AccessController.checkPermission(AccessController.java:897) java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322) java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1290) java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:174) java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:576) org.utbot.instrumentation.process.HandlerClassesLoader.loadClass(ChildProcess.kt:48) java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) org.utbot.examples.exceptions.JvmCrashExamples.crash(JvmCrashExamples.java:20) */
}
///endregion///endregion///region Test suites for executable org.utbot.examples.exceptions.JvmCrashExamples.crashPrivileged///region@Test@org.junit.Ignore(value = "Disabled due to possible JVM crash")
publicvoidtestCrashPrivileged1() {
JvmCrashExamplesjvmCrashExamples = newJvmCrashExamples();
// This invocation possibly crashes JVMjvmCrashExamples.crashPrivileged(1);
}
///endregion///endregion///region Test suites for executable org.utbot.examples.exceptions.JvmCrashExamples.exit///region FUZZER: SUCCESSFUL EXECUTIONS for method exit(int)/** * @utbot.classUnderTest {@link JvmCrashExamples} * @utbot.methodUnderTest {@link JvmCrashExamples#exit(int)} */@TestpublicvoidtestExitReturnsOne() {
JvmCrashExamplesjvmCrashExamples = newJvmCrashExamples();
intactual = jvmCrashExamples.exit(1);
assertEquals(1, actual);
}
///endregion///region OTHER: SECURITY for method exit(int)@Test@org.junit.Ignore(value = "Disabled due to sandbox")
publicvoidtestExit1() {
JvmCrashExamplesjvmCrashExamples = newJvmCrashExamples();
/* This test fails because method [org.utbot.examples.exceptions.JvmCrashExamples.exit] produces [java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "exitVM.-1")] java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) java.base/java.security.AccessController.checkPermission(AccessController.java:897) java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322) java.base/java.lang.SecurityManager.checkExit(SecurityManager.java:534) java.base/java.lang.Runtime.exit(Runtime.java:114) java.base/java.lang.System.exit(System.java:1752) org.utbot.examples.exceptions.JvmCrashExamples.exit(JvmCrashExamples.java:12) */
}
///endregion///endregion
}
Description
Generated tests disabled due to Sandbox or due to possible JVM crash are not show in SARIF-report and on Problems tab.
To Reproduce
Expected behavior
These found problems need to:
Actual behavior
Currently executions that are stopped on AccessControlException - Disabled due to sandbox - are not added to SARIF report as errors and are not displayed on Problems tab.
Same with the tests "Disabled due to possible JVM crash".
Visual proofs (screenshots, logs, images)
Additional context
Originally posted by @alisevych in #1166 (comment)