From e19d74b51ad8efd43c1583887cbde123ae769f7b Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 2 Nov 2022 11:27:08 +0000 Subject: Run-tests: Fix/implement --update; avoid stdout patching. The update has never worked reliably, but with the separation of the `sed` and `diff` it is getting much better now. Avoid stdout patching to improve --update mode further. The tests still have stdout that differs based on flags. Support those by having multiple (full) expected files. Test: test.py -r --all-target --all-jvmti --all-prebuild \ -t 1931 -t 1932 -t 1936 -t 1950 -t 1953 \ -t 1954 -t 1955 -t 1956 -t 1969 -t 909 Change-Id: I070037717f9964755492b42b6efd52179deb4125 --- test/1931-monitor-events/expected-stdout.jvm.txt | 30 +++ test/1931-monitor-events/jvm-expected.patch | 3 - test/1931-monitor-events/run.py | 4 +- .../expected-stdout.jvm.txt | 105 ++++++++++ test/1932-monitor-events-misc/jvm-expected.patch | 2 - test/1932-monitor-events-misc/run.py | 4 +- .../1936-thread-end-events/expected-stdout.jvm.txt | 49 +++++ test/1936-thread-end-events/jvm-expected.patch | 16 -- test/1936-thread-end-events/run.py | 4 +- .../expected-stdout.jvm.txt | 7 + test/1950-unprepared-transform/jvm-expected.patch | 6 - test/1950-unprepared-transform/run.py | 4 +- test/1953-pop-frame/class-loading-expected.patch | 36 ---- test/1953-pop-frame/expected-stdout.no-jvm.txt | 121 ++++++++++++ test/1953-pop-frame/run.py | 2 +- test/1954-pop-frame-jit/expected-stdout.jvm.txt | 87 +++++++++ test/1954-pop-frame-jit/jvm-expected.patch | 36 ---- test/1954-pop-frame-jit/run.py | 2 +- .../expected-stdout.jvm.txt | 87 +++++++++ test/1955-pop-frame-jit-called/jvm-expected.patch | 36 ---- test/1955-pop-frame-jit-called/run.py | 2 +- .../expected-stdout.jvm.txt | 87 +++++++++ test/1956-pop-frame-jit-calling/jvm-expected.patch | 36 ---- test/1956-pop-frame-jit-calling/run.py | 2 +- .../class-loading-expected.patch | 35 ---- .../expected-stdout.no-jvm.txt | 212 +++++++++++++++++++++ test/1969-force-early-return-void/run.py | 2 +- .../expected-stdout.interpreter.txt | 26 +++ test/909-attach-agent/interpreter-expected.patch | 4 - test/909-attach-agent/run.py | 3 +- .../expected-stdout.txt | 2 +- .../964-default-iface-init-gen/expected-stdout.txt | 2 +- .../expected-stdout.txt | 2 +- .../expected-stdout.txt | 2 +- test/971-iface-super/expected-stdout.txt | 2 +- test/run-test | 36 ++-- 36 files changed, 849 insertions(+), 247 deletions(-) create mode 100644 test/1931-monitor-events/expected-stdout.jvm.txt delete mode 100644 test/1931-monitor-events/jvm-expected.patch create mode 100644 test/1932-monitor-events-misc/expected-stdout.jvm.txt delete mode 100644 test/1932-monitor-events-misc/jvm-expected.patch create mode 100644 test/1936-thread-end-events/expected-stdout.jvm.txt delete mode 100644 test/1936-thread-end-events/jvm-expected.patch create mode 100644 test/1950-unprepared-transform/expected-stdout.jvm.txt delete mode 100644 test/1950-unprepared-transform/jvm-expected.patch delete mode 100644 test/1953-pop-frame/class-loading-expected.patch create mode 100644 test/1953-pop-frame/expected-stdout.no-jvm.txt create mode 100644 test/1954-pop-frame-jit/expected-stdout.jvm.txt delete mode 100644 test/1954-pop-frame-jit/jvm-expected.patch create mode 100644 test/1955-pop-frame-jit-called/expected-stdout.jvm.txt delete mode 100644 test/1955-pop-frame-jit-called/jvm-expected.patch create mode 100644 test/1956-pop-frame-jit-calling/expected-stdout.jvm.txt delete mode 100644 test/1956-pop-frame-jit-calling/jvm-expected.patch delete mode 100644 test/1969-force-early-return-void/class-loading-expected.patch create mode 100644 test/1969-force-early-return-void/expected-stdout.no-jvm.txt create mode 100644 test/909-attach-agent/expected-stdout.interpreter.txt delete mode 100644 test/909-attach-agent/interpreter-expected.patch diff --git a/test/1931-monitor-events/expected-stdout.jvm.txt b/test/1931-monitor-events/expected-stdout.jvm.txt new file mode 100644 index 0000000000..e26d459756 --- /dev/null +++ b/test/1931-monitor-events/expected-stdout.jvm.txt @@ -0,0 +1,30 @@ +Testing contended locking. +Locker thread 1 for NamedLock[Lock testLock] contended-LOCKING NamedLock[Lock testLock] +Locker thread 1 for NamedLock[Lock testLock] LOCKED NamedLock[Lock testLock] +Testing park. +Testing monitor wait. +Locker thread 2 for NamedLock[Lock testWait] start-monitor-wait NamedLock[Lock testWait] timeout: 0 +Locker thread 2 for NamedLock[Lock testWait] monitor-waited NamedLock[Lock testWait] timed_out: false +Testing monitor timed wait. +Locker thread 4 for NamedLock[Lock testTimedWait] start-monitor-wait NamedLock[Lock testTimedWait] timeout: 3600000 +Locker thread 4 for NamedLock[Lock testTimedWait] monitor-waited NamedLock[Lock testTimedWait] timed_out: false +Testing monitor timed with timeout. +Waiting for 10 seconds. +Locker thread 6 for NamedLock[Lock testTimedWaitTimeout] start-monitor-wait NamedLock[Lock testTimedWaitTimeout] timeout: 10000 +Locker thread 6 for NamedLock[Lock testTimedWaitTimeout] monitor-waited NamedLock[Lock testTimedWaitTimeout] timed_out: true +Wait finished with timeout. +Waiting on an unlocked monitor. +Unlocked wait thread: start-monitor-wait NamedLock[Lock testUnlockedWait] timeout: 0 +Caught exception: java.lang.reflect.InvocationTargetException + Caused by: class java.lang.IllegalMonitorStateException +Waiting with an illegal argument (negative timeout) +Locker thread 7 for NamedLock[Lock testIllegalWait] start-monitor-wait NamedLock[Lock testIllegalWait] timeout: -100 +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: Got an error while performing action TIMED_WAIT + Caused by: class java.lang.IllegalArgumentException +Interrupt a monitor being waited on. +Locker thread 8 for NamedLock[Lock testInteruptWait] start-monitor-wait NamedLock[Lock testInteruptWait] timeout: 0 +Locker thread 8 for NamedLock[Lock testInteruptWait] monitor-waited NamedLock[Lock testInteruptWait] timed_out: false +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: Got an error while performing action WAIT + Caused by: class java.lang.InterruptedException diff --git a/test/1931-monitor-events/jvm-expected.patch b/test/1931-monitor-events/jvm-expected.patch deleted file mode 100644 index 7595b145a2..0000000000 --- a/test/1931-monitor-events/jvm-expected.patch +++ /dev/null @@ -1,3 +0,0 @@ -5,6d4 -< ParkThread start-monitor-wait NamedLock[Parking blocker object] timeout: 1 -< ParkThread monitor-waited NamedLock[Parking blocker object] timed_out: true diff --git a/test/1931-monitor-events/run.py b/test/1931-monitor-events/run.py index f0d101dc38..6c5d4ad169 100644 --- a/test/1931-monitor-events/run.py +++ b/test/1931-monitor-events/run.py @@ -18,6 +18,6 @@ def run(ctx, args): ctx.default_run(args, jvmti=True) - # Art sends events for park/unpark, and the RI doesn't. Remove it from the expected output. + # Art sends events for park/unpark, and the RI doesn't. if args.jvm: - ctx.run(fr"patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null") + ctx.expected_stdout = ctx.expected_stdout.with_suffix(".jvm.txt") diff --git a/test/1932-monitor-events-misc/expected-stdout.jvm.txt b/test/1932-monitor-events-misc/expected-stdout.jvm.txt new file mode 100644 index 0000000000..b2b051ebfb --- /dev/null +++ b/test/1932-monitor-events-misc/expected-stdout.jvm.txt @@ -0,0 +1,105 @@ +Testing contended locking where lock is released before callback ends. +Locker thread 1 for NamedLock[Lock testLockUncontend] contended-LOCKING NamedLock[Lock testLockUncontend] +Releasing NamedLock[Lock testLockUncontend] during monitorEnter event. +Locker thread 1 for NamedLock[Lock testLockUncontend] LOCKED NamedLock[Lock testLockUncontend] +Testing throwing exceptions in monitor_enter +Locker thread 3 for NamedLock[Lock testLockThrowEnter] contended-LOCKING NamedLock[Lock testLockThrowEnter] +Throwing exception in MonitorEnter +Locker thread 3 for NamedLock[Lock testLockThrowEnter] LOCKED NamedLock[Lock testLockThrowEnter] +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during monitorEnter of NamedLock[Lock testLockThrowEnter] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testLockThrowEnter], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing throwing exceptions in monitor_entered +Locker thread 5 for NamedLock[Lock testLockThrowEntered] contended-LOCKING NamedLock[Lock testLockThrowEntered] +Locker thread 5 for NamedLock[Lock testLockThrowEntered] LOCKED NamedLock[Lock testLockThrowEntered] +Throwing exception in MonitorEntered +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during monitorEntered of NamedLock[Lock testLockThrowEntered] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testLockThrowEntered], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing throwing exceptions in both monitorEnter & MonitorEntered +Locker thread 7 for NamedLock[Lock testLockThrowBoth] contended-LOCKING NamedLock[Lock testLockThrowBoth] +Throwing exception in MonitorEnter +Locker thread 7 for NamedLock[Lock testLockThrowBoth] LOCKED NamedLock[Lock testLockThrowBoth] +Throwing exception in MonitorEntered +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during monitorEntered of NamedLock[Lock testLockThrowBoth] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testLockThrowBoth], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing throwing exception in MonitorWait event +Locker thread 8 for NamedLock[Lock testThrowWait] start-monitor-wait NamedLock[Lock testThrowWait] timeout: 0 +Throwing exception in MonitorWait +Locker thread 8 for NamedLock[Lock testThrowWait] monitor-waited NamedLock[Lock testThrowWait] timed_out: false +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during MonitorWait of NamedLock[Lock testThrowWait] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testThrowWait], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing throwing exception in MonitorWait event with illegal aruments +Locker thread 9 for NamedLock[Lock testThrowIllegalWait] start-monitor-wait NamedLock[Lock testThrowIllegalWait] timeout: -100000 +Throwing exception in MonitorWait timeout = -100000 +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during monitorWait of NamedLock[Lock testThrowIllegalWait] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testThrowIllegalWait], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing throwing exception in MonitorWaited event +Locker thread 10 for NamedLock[Lock testThrowWaited] start-monitor-wait NamedLock[Lock testThrowWaited] timeout: 0 +Locker thread 10 for NamedLock[Lock testThrowWaited] monitor-waited NamedLock[Lock testThrowWaited] timed_out: false +Throwing exception in MonitorWaited +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during monitorWaited of NamedLock[Lock testThrowWaited] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testThrowWaited], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing throwing exception in MonitorWaited event caused by timeout +Locker thread 12 for NamedLock[Lock testThrowWaitedTimeout] start-monitor-wait NamedLock[Lock testThrowWaitedTimeout] timeout: 5000 +Locker thread 12 for NamedLock[Lock testThrowWaitedTimeout] monitor-waited NamedLock[Lock testThrowWaitedTimeout] timed_out: true +Throwing exception in MonitorWaited +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during monitorWaited of NamedLock[Lock testThrowWaitedTimeout] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testThrowWaitedTimeout], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing throwing exception in MonitorWaited event caused by interrupt +Locker thread 13 for NamedLock[Lock testThrowWaitedInterrupt] start-monitor-wait NamedLock[Lock testThrowWaitedInterrupt] timeout: 0 +Locker thread 13 for NamedLock[Lock testThrowWaitedInterrupt] monitor-waited NamedLock[Lock testThrowWaitedInterrupt] timed_out: false +Throwing exception in MonitorWaited +Caught exception: art.Monitors$TestException: Exception thrown by other thread! + Caused by: art.Monitors$TestException: throwing exception during monitorWaited of NamedLock[Lock testThrowWaitedInterrupt] +lock state is: MonitorUsage{ monitor: NamedLock[Lock testThrowWaitedInterrupt], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing ObjectMonitorInfo inside of events +Locker thread 15 for NamedLock[Lock testMonitorInfoInEvents] contended-LOCKING NamedLock[Lock testMonitorInfoInEvents] +Monitor usage in MonitorEnter: MonitorUsage{ monitor: NamedLock[Lock testMonitorInfoInEvents], owner: Locker thread 14 for NamedLock[Lock testMonitorInfoInEvents], entryCount: 1, waiters: [], notify_waiters: [] } +Locker thread 15 for NamedLock[Lock testMonitorInfoInEvents] LOCKED NamedLock[Lock testMonitorInfoInEvents] +Monitor usage in MonitorEntered: MonitorUsage{ monitor: NamedLock[Lock testMonitorInfoInEvents], owner: Locker thread 15 for NamedLock[Lock testMonitorInfoInEvents], entryCount: 1, waiters: [], notify_waiters: [] } +Locker thread 15 for NamedLock[Lock testMonitorInfoInEvents] start-monitor-wait NamedLock[Lock testMonitorInfoInEvents] timeout: 0 +Monitor usage in MonitorWait: MonitorUsage{ monitor: NamedLock[Lock testMonitorInfoInEvents], owner: Locker thread 15 for NamedLock[Lock testMonitorInfoInEvents], entryCount: 1, waiters: [], notify_waiters: [] } +Locker thread 15 for NamedLock[Lock testMonitorInfoInEvents] monitor-waited NamedLock[Lock testMonitorInfoInEvents] timed_out: false +Monitor usage in MonitorWaited: MonitorUsage{ monitor: NamedLock[Lock testMonitorInfoInEvents], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +Testing that the monitor can be stolen during the MonitorWaited event. +Locker thread 17 for NamedLock[test testWaitEnterInterleaving] start-monitor-wait NamedLock[test testWaitEnterInterleaving] timeout: 0 +Locker thread 17 for NamedLock[test testWaitEnterInterleaving] monitor-waited NamedLock[test testWaitEnterInterleaving] timed_out: false +locking controller3 in controller2 MonitorWaited event +Controller3 now holds the lock the monitor wait will try to re-acquire +Testing that we can lock and release the monitor in the MonitorWait event +Locker thread 20 for NamedLock[test testWaitMonitorEnter] start-monitor-wait NamedLock[test testWaitMonitorEnter] timeout: 0 +In wait monitor usage: MonitorUsage{ monitor: NamedLock[test testWaitMonitorEnter], owner: Locker thread 20 for NamedLock[test testWaitMonitorEnter], entryCount: 1, waiters: [], notify_waiters: [] } +In wait monitor usage sync: MonitorUsage{ monitor: NamedLock[test testWaitMonitorEnter], owner: Locker thread 20 for NamedLock[test testWaitMonitorEnter], entryCount: 2, waiters: [], notify_waiters: [] } +Locker thread 20 for NamedLock[test testWaitMonitorEnter] monitor-waited NamedLock[test testWaitMonitorEnter] timed_out: false +Testing that we can lock and release the monitor in the MonitorWaited event +Locker thread 22 for NamedLock[test testWaitedMonitorEnter] start-monitor-wait NamedLock[test testWaitedMonitorEnter] timeout: 0 +Locker thread 22 for NamedLock[test testWaitedMonitorEnter] monitor-waited NamedLock[test testWaitedMonitorEnter] timed_out: false +In waited monitor usage: MonitorUsage{ monitor: NamedLock[test testWaitedMonitorEnter], owner: , entryCount: 0, waiters: [], notify_waiters: [] } +In waited monitor usage sync: MonitorUsage{ monitor: NamedLock[test testWaitedMonitorEnter], owner: Locker thread 22 for NamedLock[test testWaitedMonitorEnter], entryCount: 1, waiters: [], notify_waiters: [] } +Testing we can perform recursive lock in MonitorEntered +Locker thread 25 for NamedLock[test testRecursiveMontiorEnteredLock] contended-LOCKING NamedLock[test testRecursiveMontiorEnteredLock] +Locker thread 25 for NamedLock[test testRecursiveMontiorEnteredLock] LOCKED NamedLock[test testRecursiveMontiorEnteredLock] +In MonitorEntered usage: MonitorUsage{ monitor: NamedLock[test testRecursiveMontiorEnteredLock], owner: Locker thread 25 for NamedLock[test testRecursiveMontiorEnteredLock], entryCount: 1, waiters: [], notify_waiters: [] } +In MonitorEntered sync: MonitorUsage{ monitor: NamedLock[test testRecursiveMontiorEnteredLock], owner: Locker thread 25 for NamedLock[test testRecursiveMontiorEnteredLock], entryCount: 2, waiters: [], notify_waiters: [] } +Testing the lock state if MonitorEnter throws in a native method +NativeLockStateThrowEnter thread contended-LOCKING NamedLock[test testNativeLockStateThrowEnter] +Unlocking controller1 in MonitorEnter +Throwing exception in MonitorEnter +NativeLockStateThrowEnter thread LOCKED NamedLock[test testNativeLockStateThrowEnter] +MonitorEnter returned: -1 +Lock state is: MonitorUsage{ monitor: NamedLock[test testNativeLockStateThrowEnter], owner: NativeLockStateThrowEnter thread, entryCount: 1, waiters: [], notify_waiters: [] } +Caught exception: art.Monitors$TestException: throwing exception during monitorEnter of NamedLock[test testNativeLockStateThrowEnter] +Testing the lock state if MonitorEntered throws in a native method +NativeLockStateThrowEntered thread contended-LOCKING NamedLock[test testNativeLockStateThrowEntered] +Unlocking controller1 in MonitorEnter +NativeLockStateThrowEntered thread LOCKED NamedLock[test testNativeLockStateThrowEntered] +Throwing exception in MonitorEntered +MonitorEnter returned: -1 +Lock state is: MonitorUsage{ monitor: NamedLock[test testNativeLockStateThrowEntered], owner: NativeLockStateThrowEntered thread, entryCount: 1, waiters: [], notify_waiters: [] } +Caught exception: art.Monitors$TestException: throwing exception during monitorEntered of NamedLock[test testNativeLockStateThrowEntered] diff --git a/test/1932-monitor-events-misc/jvm-expected.patch b/test/1932-monitor-events-misc/jvm-expected.patch deleted file mode 100644 index f6b2285a3f..0000000000 --- a/test/1932-monitor-events-misc/jvm-expected.patch +++ /dev/null @@ -1,2 +0,0 @@ -29a30 -> Locker thread 8 for NamedLock[Lock testThrowWait] monitor-waited NamedLock[Lock testThrowWait] timed_out: false diff --git a/test/1932-monitor-events-misc/run.py b/test/1932-monitor-events-misc/run.py index 21067d0f3b..43e66fdbe9 100644 --- a/test/1932-monitor-events-misc/run.py +++ b/test/1932-monitor-events-misc/run.py @@ -18,6 +18,6 @@ def run(ctx, args): ctx.default_run(args, jvmti=True) - # The RI sends an extra event that art doesn't. Add it to the expected output. + # The RI sends an extra event that art doesn't. if args.jvm: - ctx.run(fr"patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null") + ctx.expected_stdout = ctx.expected_stdout.with_suffix(".jvm.txt") diff --git a/test/1936-thread-end-events/expected-stdout.jvm.txt b/test/1936-thread-end-events/expected-stdout.jvm.txt new file mode 100644 index 0000000000..a8e79a44c8 --- /dev/null +++ b/test/1936-thread-end-events/expected-stdout.jvm.txt @@ -0,0 +1,49 @@ +Entered public static void art.Test1936.foo() +Thread: test-thread + | alive: true + | interrupted: false + | daemon: false + | group: java.lang.ThreadGroup[name=main,maxpri=10] + +Entered private void java.lang.Thread.exit() +Thread: test-thread + | alive: true + | interrupted: false + | daemon: false + | group: java.lang.ThreadGroup[name=main,maxpri=10] + +Entered void java.lang.ThreadGroup.threadTerminated(java.lang.Thread) +Thread: test-thread + | alive: true + | interrupted: false + | daemon: false + | group: java.lang.ThreadGroup[name=main,maxpri=10] + +Entered private void java.lang.ThreadGroup.remove(java.lang.Thread) +Thread: test-thread + | alive: true + | interrupted: false + | daemon: false + | group: java.lang.ThreadGroup[name=main,maxpri=10] + +Entered public static native void java.lang.System.arraycopy(java.lang.Object,int,java.lang.Object,int,int) +Thread: test-thread + | alive: true + | interrupted: false + | daemon: false + | group: java.lang.ThreadGroup[name=main,maxpri=10] + +Entered public static void art.Test1936.NotifyThreadEnd(java.lang.Thread) +Thread: test-thread + | alive: true + | interrupted: false + | daemon: false + | group: null + +Entered public static void art.Test1936.foo() +Thread: test-thread + | alive: true + | interrupted: false + | daemon: false + | group: null + diff --git a/test/1936-thread-end-events/jvm-expected.patch b/test/1936-thread-end-events/jvm-expected.patch deleted file mode 100644 index ddb30a326c..0000000000 --- a/test/1936-thread-end-events/jvm-expected.patch +++ /dev/null @@ -1,16 +0,0 @@ -7a8,14 -> Entered private void java.lang.Thread.exit() -> Thread: test-thread -> | alive: true -> | interrupted: false -> | daemon: false -> | group: java.lang.ThreadGroup[name=main,maxpri=10] -> -34c41 -< | group: java.lang.ThreadGroup[name=main,maxpri=10] ---- -> | group: null -41c48 -< | group: java.lang.ThreadGroup[name=main,maxpri=10] ---- -> | group: null diff --git a/test/1936-thread-end-events/run.py b/test/1936-thread-end-events/run.py index 9ac67c0375..3e1a8e9e3c 100644 --- a/test/1936-thread-end-events/run.py +++ b/test/1936-thread-end-events/run.py @@ -19,6 +19,6 @@ def run(ctx, args): # Ask for stack traces to be dumped to a file rather than to stdout. ctx.default_run(args, jvmti=True) - # The RI sends an extra event that art doesn't. Add it to the expected output. + # The RI sends an extra event that art doesn't. if args.jvm: - ctx.run(fr"patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null") + ctx.expected_stdout = ctx.expected_stdout.with_suffix(".jvm.txt") diff --git a/test/1950-unprepared-transform/expected-stdout.jvm.txt b/test/1950-unprepared-transform/expected-stdout.jvm.txt new file mode 100644 index 0000000000..cc470e13fb --- /dev/null +++ b/test/1950-unprepared-transform/expected-stdout.jvm.txt @@ -0,0 +1,7 @@ +Redefine in ClassLoad on current thread. +retransformClasses on an unprepared class succeeded +Object out is: Transformed object! +Redefine during ClassLoad on another thread. +retransformClasses on an unprepared class succeeded +Object out is: Transformed object! +Redefinition thread finished. diff --git a/test/1950-unprepared-transform/jvm-expected.patch b/test/1950-unprepared-transform/jvm-expected.patch deleted file mode 100644 index fd0131e5e4..0000000000 --- a/test/1950-unprepared-transform/jvm-expected.patch +++ /dev/null @@ -1,6 +0,0 @@ -2,3c2,3 -< Trying to redefine: class Transform. Caught error class java.lang.Exception: Failed to retransform class due to JVMTI_ERROR_INTERNAL -< Object out is: NON Transformed Object ---- -> retransformClasses on an unprepared class succeeded -> Object out is: Transformed object! diff --git a/test/1950-unprepared-transform/run.py b/test/1950-unprepared-transform/run.py index 82d1a0e4be..995bbbda7a 100644 --- a/test/1950-unprepared-transform/run.py +++ b/test/1950-unprepared-transform/run.py @@ -18,6 +18,6 @@ def run(ctx, args): ctx.default_run(args, jvmti=True, app_image=False) - # The RI sends an extra event that art doesn't. Add it to the expected output. + # The RI sends an extra event that art doesn't. if args.jvm: - ctx.run(fr"patch -p0 expected-stdout.txt < jvm-expected.patch >/dev/null") + ctx.expected_stdout = ctx.expected_stdout.with_suffix(".jvm.txt") 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) ->