diff options
author | 2022-10-22 13:09:47 +0100 | |
---|---|---|
committer | 2022-10-24 09:09:24 +0000 | |
commit | d9e355921fb2f039c3a19a8cf23d78ab87c1f390 (patch) | |
tree | 328cd831b2496eff9b67142d74c0572a96bf4f7a | |
parent | caf21e3964fe67a4a714356d75a5e23b05af3959 (diff) |
Fix run-test check for --jvmti-redefine-stress
Adjust the patch condition for jvmti-redefine-stress as well.
Invert the patch for some tests to make them consistent.
Test: ./art/test.py -r --all-target --optimizing --all-jvmti \
-t 1953 -t 1954 -t 1955 -t 1956 -t 1969
Change-Id: Ib8519885e3603a15542e3c31f0df90f373deb4a3
-rwxr-xr-x | test/1953-pop-frame/check | 6 | ||||
-rw-r--r-- | test/1953-pop-frame/class-loading-expected.patch | 36 | ||||
-rw-r--r-- | test/1953-pop-frame/expected-stdout.txt | 34 | ||||
-rw-r--r-- | test/1953-pop-frame/jvm-expected.patch | 36 | ||||
-rwxr-xr-x | test/1954-pop-frame-jit/check | 4 | ||||
-rwxr-xr-x | test/1955-pop-frame-jit-called/check | 4 | ||||
-rwxr-xr-x | test/1956-pop-frame-jit-calling/check | 4 | ||||
-rwxr-xr-x | test/1969-force-early-return-void/check | 5 | ||||
-rw-r--r-- | test/1969-force-early-return-void/class-loading-expected.patch | 35 | ||||
-rw-r--r-- | test/1969-force-early-return-void/expected-stdout.txt | 34 | ||||
-rw-r--r-- | test/1969-force-early-return-void/jvm-expected.patch | 35 | ||||
-rwxr-xr-x | test/run-test | 5 |
12 files changed, 160 insertions, 78 deletions
diff --git a/test/1953-pop-frame/check b/test/1953-pop-frame/check index 65e96ffe2c..a3b6fa642b 100755 --- a/test/1953-pop-frame/check +++ b/test/1953-pop-frame/check @@ -23,6 +23,8 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -if [[ "$TEST_RUNTIME" != "jvm" && "x$VERIFY_SOFT_FAIL" != "xtrue" ]]; then - patch -p0 expected-stdout.txt < class-loading-expected.patch +if [[ "$TEST_RUNTIME" == "jvm" || \ + "$VERIFY_SOFT_FAIL" == "true" || \ + ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then + patch -p0 expected-stdout.txt < jvm-expected.patch fi diff --git a/test/1953-pop-frame/class-loading-expected.patch b/test/1953-pop-frame/class-loading-expected.patch deleted file mode 100644 index 1a5eda7fd6..0000000000 --- a/test/1953-pop-frame/class-loading-expected.patch +++ /dev/null @@ -1,36 +0,0 @@ -36a37,50 -> Test stopped during notifyFramePop without exception on pop of calledFunction -> Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0 -> result is StandardTestObject { cnt: 2 } base-call count: 1 -> Test stopped during notifyFramePop without exception on pop of doNothing -> Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0 -> result is StandardTestObject { cnt: 1 } base-call count: 1 -> Test stopped during notifyFramePop with exception on pop of calledFunction -> Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0 -> art.Test1953$ExceptionThrowTestObject$TestError thrown and caught! -> result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1 -> Test stopped during notifyFramePop with exception on pop of doThrow -> Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0 -> art.Test1953$ExceptionCatchTestObject$TestError caught in called function. -> result is ExceptionCatchTestObject { cnt: 1 } base-call count: 1 -60a75,94 -> Test stopped during a ClassLoad event. -> Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 0} base-call-count: 0 -> Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME -> art.Test1953.popFrame(Native Method) -> art.Test1953.runTestOn(Test1953.java) -> art.Test1953.runTestOn(Test1953.java) -> art.Test1953.runTests(Test1953.java) -> <Additional frames hidden> -> TC0.foo == 1 -> result is ClassLoadObject { cnt: 1, curClass: 1} base-call count: 1 -> Test stopped during a ClassPrepare event. -> Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 1} base-call-count: 0 -> Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME -> art.Test1953.popFrame(Native Method) -> art.Test1953.runTestOn(Test1953.java) -> art.Test1953.runTestOn(Test1953.java) -> art.Test1953.runTests(Test1953.java) -> <Additional frames hidden> -> TC1.foo == 2 -> result is ClassLoadObject { cnt: 1, curClass: 2} base-call count: 1 diff --git a/test/1953-pop-frame/expected-stdout.txt b/test/1953-pop-frame/expected-stdout.txt index dafc6b4c92..e75ea64855 100644 --- a/test/1953-pop-frame/expected-stdout.txt +++ b/test/1953-pop-frame/expected-stdout.txt @@ -34,6 +34,20 @@ result is ExceptionOnceObject { cnt: 2, throwInSub: false } base-call count: 1 Test stopped during Method Exit due to exception thrown in subroutine Single call with PopFrame on ExceptionOnceObject { cnt: 0, throwInSub: true } base-call-count: 0 result is ExceptionOnceObject { cnt: 2, throwInSub: true } base-call count: 1 +Test stopped during notifyFramePop without exception on pop of calledFunction +Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0 +result is StandardTestObject { cnt: 2 } base-call count: 1 +Test stopped during notifyFramePop without exception on pop of doNothing +Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0 +result is StandardTestObject { cnt: 1 } base-call count: 1 +Test stopped during notifyFramePop with exception on pop of calledFunction +Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0 +art.Test1953$ExceptionThrowTestObject$TestError thrown and caught! +result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1 +Test stopped during notifyFramePop with exception on pop of doThrow +Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0 +art.Test1953$ExceptionCatchTestObject$TestError caught in called function. +result is ExceptionCatchTestObject { cnt: 1 } base-call count: 1 Test stopped during ExceptionCatch event of calledFunction (catch in called function, throw in called function) Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0 art.Test1953$ExceptionThrowTestObject$TestError caught in same function. @@ -58,6 +72,26 @@ Test stopped during Exception event of calledFunction (catch in called function) Single call with PopFrame on ExceptionThrowFarTestObject { cnt: 0 } base-call-count: 0 art.Test1953$ExceptionThrowFarTestObject$TestError caught in same function. result is ExceptionThrowFarTestObject { cnt: 2 } base-call count: 1 +Test stopped during a ClassLoad event. +Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 0} base-call-count: 0 +Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME + art.Test1953.popFrame(Native Method) + art.Test1953.runTestOn(Test1953.java) + art.Test1953.runTestOn(Test1953.java) + art.Test1953.runTests(Test1953.java) + <Additional frames hidden> +TC0.foo == 1 +result is ClassLoadObject { cnt: 1, curClass: 1} base-call count: 1 +Test stopped during a ClassPrepare event. +Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 1} base-call-count: 0 +Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME + art.Test1953.popFrame(Native Method) + art.Test1953.runTestOn(Test1953.java) + art.Test1953.runTestOn(Test1953.java) + art.Test1953.runTests(Test1953.java) + <Additional frames hidden> +TC1.foo == 2 +result is ClassLoadObject { cnt: 1, curClass: 2} base-call count: 1 Test stopped during random Suspend. Single call with PopFrame on SuspendSuddenlyObject { cnt: 0 } base-call-count: 0 result is SuspendSuddenlyObject { cnt: 2 } base-call count: 1 diff --git a/test/1953-pop-frame/jvm-expected.patch b/test/1953-pop-frame/jvm-expected.patch new file mode 100644 index 0000000000..6539d56b27 --- /dev/null +++ b/test/1953-pop-frame/jvm-expected.patch @@ -0,0 +1,36 @@ +37,50d36 +< Test stopped during notifyFramePop without exception on pop of calledFunction +< Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0 +< result is StandardTestObject { cnt: 2 } base-call count: 1 +< Test stopped during notifyFramePop without exception on pop of doNothing +< Single call with PopFrame on StandardTestObject { cnt: 0 } base-call-count: 0 +< result is StandardTestObject { cnt: 1 } base-call count: 1 +< Test stopped during notifyFramePop with exception on pop of calledFunction +< Single call with PopFrame on ExceptionThrowTestObject { cnt: 0 } base-call-count: 0 +< art.Test1953$ExceptionThrowTestObject$TestError thrown and caught! +< result is ExceptionThrowTestObject { cnt: 2 } base-call count: 1 +< Test stopped during notifyFramePop with exception on pop of doThrow +< Single call with PopFrame on ExceptionCatchTestObject { cnt: 0 } base-call-count: 0 +< art.Test1953$ExceptionCatchTestObject$TestError caught in called function. +< result is ExceptionCatchTestObject { cnt: 1 } base-call count: 1 +75,94d60 +< Test stopped during a ClassLoad event. +< Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 0} base-call-count: 0 +< Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME +< art.Test1953.popFrame(Native Method) +< art.Test1953.runTestOn(Test1953.java) +< art.Test1953.runTestOn(Test1953.java) +< art.Test1953.runTests(Test1953.java) +< <Additional frames hidden> +< TC0.foo == 1 +< result is ClassLoadObject { cnt: 1, curClass: 1} base-call count: 1 +< Test stopped during a ClassPrepare event. +< Single call with PopFrame on ClassLoadObject { cnt: 0, curClass: 1} base-call-count: 0 +< Failed to pop frame due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME +< art.Test1953.popFrame(Native Method) +< art.Test1953.runTestOn(Test1953.java) +< art.Test1953.runTestOn(Test1953.java) +< art.Test1953.runTests(Test1953.java) +< <Additional frames hidden> +< TC1.foo == 2 +< result is ClassLoadObject { cnt: 1, curClass: 2} base-call count: 1 diff --git a/test/1954-pop-frame-jit/check b/test/1954-pop-frame-jit/check index d2d1843a08..a3b6fa642b 100755 --- a/test/1954-pop-frame-jit/check +++ b/test/1954-pop-frame-jit/check @@ -23,6 +23,8 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then +if [[ "$TEST_RUNTIME" == "jvm" || \ + "$VERIFY_SOFT_FAIL" == "true" || \ + ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then patch -p0 expected-stdout.txt < jvm-expected.patch fi diff --git a/test/1955-pop-frame-jit-called/check b/test/1955-pop-frame-jit-called/check index d2d1843a08..a3b6fa642b 100755 --- a/test/1955-pop-frame-jit-called/check +++ b/test/1955-pop-frame-jit-called/check @@ -23,6 +23,8 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then +if [[ "$TEST_RUNTIME" == "jvm" || \ + "$VERIFY_SOFT_FAIL" == "true" || \ + ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then patch -p0 expected-stdout.txt < jvm-expected.patch fi diff --git a/test/1956-pop-frame-jit-calling/check b/test/1956-pop-frame-jit-calling/check index d2d1843a08..a3b6fa642b 100755 --- a/test/1956-pop-frame-jit-calling/check +++ b/test/1956-pop-frame-jit-calling/check @@ -23,6 +23,8 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -if [[ "$TEST_RUNTIME" == "jvm" || "x$VERIFY_SOFT_FAIL" == "xtrue" ]]; then +if [[ "$TEST_RUNTIME" == "jvm" || \ + "$VERIFY_SOFT_FAIL" == "true" || \ + ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then patch -p0 expected-stdout.txt < jvm-expected.patch fi diff --git a/test/1969-force-early-return-void/check b/test/1969-force-early-return-void/check index 2e0de80df6..0619e49e91 100755 --- a/test/1969-force-early-return-void/check +++ b/test/1969-force-early-return-void/check @@ -23,6 +23,7 @@ # The RI has restrictions and bugs around some PopFrame behavior that ART lacks. # See b/116003018. Some configurations cannot handle the class load events in # quite the right way so they are disabled there too. -if [[ "$VERIFY_SOFT_FAIL" != "true" ]]; then - patch -p0 expected-stdout.txt < class-loading-expected.patch +if [[ "$VERIFY_SOFT_FAIL" == "true" || \ + ("$JVMTI_REDEFINE_STRESS" == "true" && "$RUN_MODE" == "host") ]]; then + patch -p0 expected-stdout.txt < jvm-expected.patch fi diff --git a/test/1969-force-early-return-void/class-loading-expected.patch b/test/1969-force-early-return-void/class-loading-expected.patch deleted file mode 100644 index 5e13595eb8..0000000000 --- a/test/1969-force-early-return-void/class-loading-expected.patch +++ /dev/null @@ -1,35 +0,0 @@ -178a179,212 -> Test stopped during class-load. -> NORMAL RUN: Single call with no interference on (ID: 46) ClassLoadObject { cnt: 0, curClass: 0} -> TC0.foo == 100 -> NORMAL RUN: result for (ID: 46) ClassLoadObject { cnt: 1, curClass: 1} on Test1969 target thread - 46 -> Single call with force-early-return on (ID: 47) ClassLoadObject { cnt: 0, curClass: 1} -> Will force return of Test1969 target thread - 47 -> Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME -> art.NonStandardExit.forceEarlyReturnVoid(Native Method) -> art.Test1969$TestSuspender.performForceReturn(Test1969.java) -> art.Test1969.runTestOn(Test1969.java) -> art.Test1969.runTestOn(Test1969.java) -> art.Test1969.runTestOn(Test1969.java) -> art.Test1969.runTests(Test1969.java) -> <Additional frames hidden> -> -> TC1.foo == 201 -> result for (ID: 47) ClassLoadObject { cnt: 1, curClass: 2} on Test1969 target thread - 47 -> Test stopped during class-load. -> NORMAL RUN: Single call with no interference on (ID: 48) ClassLoadObject { cnt: 0, curClass: 2} -> TC2.foo == 302 -> NORMAL RUN: result for (ID: 48) ClassLoadObject { cnt: 1, curClass: 3} on Test1969 target thread - 48 -> Single call with force-early-return on (ID: 49) ClassLoadObject { cnt: 0, curClass: 3} -> Will force return of Test1969 target thread - 49 -> Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME -> art.NonStandardExit.forceEarlyReturnVoid(Native Method) -> art.Test1969$TestSuspender.performForceReturn(Test1969.java) -> art.Test1969.runTestOn(Test1969.java) -> art.Test1969.runTestOn(Test1969.java) -> art.Test1969.runTestOn(Test1969.java) -> art.Test1969.runTests(Test1969.java) -> <Additional frames hidden> -> -> TC3.foo == 403 -> result for (ID: 49) ClassLoadObject { cnt: 1, curClass: 4} on Test1969 target thread - 49 diff --git a/test/1969-force-early-return-void/expected-stdout.txt b/test/1969-force-early-return-void/expected-stdout.txt index fc685b4fee..1bb3252b22 100644 --- a/test/1969-force-early-return-void/expected-stdout.txt +++ b/test/1969-force-early-return-void/expected-stdout.txt @@ -176,3 +176,37 @@ NORMAL RUN: result for (ID: 44) ObjectInitTestObject { cnt: 2 } on Test1969 targ Single call with force-early-return on (ID: 45) ObjectInitTestObject { cnt: 0 } Will force return of Test1969 target thread - 45 result for (ID: 45) ObjectInitTestObject { cnt: 1 } on Test1969 target thread - 45 +Test stopped during class-load. +NORMAL RUN: Single call with no interference on (ID: 46) ClassLoadObject { cnt: 0, curClass: 0} +TC0.foo == 100 +NORMAL RUN: result for (ID: 46) ClassLoadObject { cnt: 1, curClass: 1} on Test1969 target thread - 46 +Single call with force-early-return on (ID: 47) ClassLoadObject { cnt: 0, curClass: 1} +Will force return of Test1969 target thread - 47 +Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME + art.NonStandardExit.forceEarlyReturnVoid(Native Method) + art.Test1969$TestSuspender.performForceReturn(Test1969.java) + art.Test1969.runTestOn(Test1969.java) + art.Test1969.runTestOn(Test1969.java) + art.Test1969.runTestOn(Test1969.java) + art.Test1969.runTests(Test1969.java) + <Additional frames hidden> + +TC1.foo == 201 +result for (ID: 47) ClassLoadObject { cnt: 1, curClass: 2} on Test1969 target thread - 47 +Test stopped during class-load. +NORMAL RUN: Single call with no interference on (ID: 48) ClassLoadObject { cnt: 0, curClass: 2} +TC2.foo == 302 +NORMAL RUN: result for (ID: 48) ClassLoadObject { cnt: 1, curClass: 3} on Test1969 target thread - 48 +Single call with force-early-return on (ID: 49) ClassLoadObject { cnt: 0, curClass: 3} +Will force return of Test1969 target thread - 49 +Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME + art.NonStandardExit.forceEarlyReturnVoid(Native Method) + art.Test1969$TestSuspender.performForceReturn(Test1969.java) + art.Test1969.runTestOn(Test1969.java) + art.Test1969.runTestOn(Test1969.java) + art.Test1969.runTestOn(Test1969.java) + art.Test1969.runTests(Test1969.java) + <Additional frames hidden> + +TC3.foo == 403 +result for (ID: 49) ClassLoadObject { cnt: 1, curClass: 4} on Test1969 target thread - 49 diff --git a/test/1969-force-early-return-void/jvm-expected.patch b/test/1969-force-early-return-void/jvm-expected.patch new file mode 100644 index 0000000000..d01823922e --- /dev/null +++ b/test/1969-force-early-return-void/jvm-expected.patch @@ -0,0 +1,35 @@ +179,212d178 +< Test stopped during class-load. +< NORMAL RUN: Single call with no interference on (ID: 46) ClassLoadObject { cnt: 0, curClass: 0} +< TC0.foo == 100 +< NORMAL RUN: result for (ID: 46) ClassLoadObject { cnt: 1, curClass: 1} on Test1969 target thread - 46 +< Single call with force-early-return on (ID: 47) ClassLoadObject { cnt: 0, curClass: 1} +< Will force return of Test1969 target thread - 47 +< Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME +< art.NonStandardExit.forceEarlyReturnVoid(Native Method) +< art.Test1969$TestSuspender.performForceReturn(Test1969.java) +< art.Test1969.runTestOn(Test1969.java) +< art.Test1969.runTestOn(Test1969.java) +< art.Test1969.runTestOn(Test1969.java) +< art.Test1969.runTests(Test1969.java) +< <Additional frames hidden> +< +< TC1.foo == 201 +< result for (ID: 47) ClassLoadObject { cnt: 1, curClass: 2} on Test1969 target thread - 47 +< Test stopped during class-load. +< NORMAL RUN: Single call with no interference on (ID: 48) ClassLoadObject { cnt: 0, curClass: 2} +< TC2.foo == 302 +< NORMAL RUN: result for (ID: 48) ClassLoadObject { cnt: 1, curClass: 3} on Test1969 target thread - 48 +< Single call with force-early-return on (ID: 49) ClassLoadObject { cnt: 0, curClass: 3} +< Will force return of Test1969 target thread - 49 +< Failed to force-return due to java.lang.RuntimeException: JVMTI_ERROR_OPAQUE_FRAME +< art.NonStandardExit.forceEarlyReturnVoid(Native Method) +< art.Test1969$TestSuspender.performForceReturn(Test1969.java) +< art.Test1969.runTestOn(Test1969.java) +< art.Test1969.runTestOn(Test1969.java) +< art.Test1969.runTestOn(Test1969.java) +< art.Test1969.runTests(Test1969.java) +< <Additional frames hidden> +< +< TC3.foo == 403 +< result for (ID: 49) ClassLoadObject { cnt: 1, curClass: 4} on Test1969 target thread - 49 diff --git a/test/run-test b/test/run-test index f5820fad29..31ab76e926 100755 --- a/test/run-test +++ b/test/run-test @@ -154,6 +154,7 @@ if True: target_mode = "no" DEX_LOCATION = tmp_dir run_args += ["--host"] + os.environ["RUN_MODE"] = "host" shift() elif arg == "--quiet": quiet = "yes" @@ -222,15 +223,19 @@ if True: shift() elif arg == "--jvmti-step-stress": jvmti_step_stress = "true" + os.environ["JVMTI_STEP_STRESS"] = "true" shift() elif arg == "--jvmti-redefine-stress": jvmti_redefine_stress = "true" + os.environ["JVMTI_REDEFINE_STRESS"] = "true" shift() elif arg == "--jvmti-field-stress": jvmti_field_stress = "true" + os.environ["JVMTI_FIELD_STRESS"] = "true" shift() elif arg == "--jvmti-trace-stress": jvmti_trace_stress = "true" + os.environ["JVMTI_TRACE_STRESS"] = "true" shift() elif arg == "--suspend-timeout": shift() |