# HG changeset patch # User mgronlun # Date 1573467915 -3600 # Node ID 01d47d511f5f0017f7390642668fbe0a4495cba7 # Parent 586415e8abcb726151a9aa9094b77605500c4771 8231922: Could not find field with name revokedClass Reviewed-by: egahlin diff -r 586415e8abcb -r 01d47d511f5f test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java --- a/test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java Mon Nov 11 10:41:03 2019 +0100 +++ b/test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java Mon Nov 11 11:25:15 2019 +0100 @@ -101,8 +101,9 @@ } // Retrieve all biased lock revocation events related to the provided lock class, sorted by start time - static List getRevocationEvents(Recording recording, String fieldName, Class lockClass) throws Throwable { + static List getRevocationEvents(Recording recording, String eventTypeName, String fieldName, Class lockClass) throws Throwable { return Events.fromRecording(recording).stream() + .filter(e -> e.getEventType().getName().equals(eventTypeName)) .filter(e -> ((RecordedClass)e.getValue(fieldName)).getName().equals(lockClass.getName())) .sorted(Comparator.comparing(RecordedEvent::getStartTime)) .collect(Collectors.toList()); @@ -119,7 +120,7 @@ Thread biasBreaker = triggerRevocation(1, MyLock.class); recording.stop(); - List events = getRevocationEvents(recording, "lockClass", MyLock.class); + List events = getRevocationEvents(recording, EventNames.BiasedLockRevocation, "lockClass", MyLock.class); Asserts.assertEQ(events.size(), 1); RecordedEvent event = events.get(0); @@ -143,7 +144,7 @@ Thread biasBreaker = triggerRevocation(BULK_REVOKE_THRESHOLD, MyLock.class); recording.stop(); - List events = getRevocationEvents(recording, "revokedClass", MyLock.class); + List events = getRevocationEvents(recording, EventNames.BiasedLockClassRevocation, "revokedClass", MyLock.class); Asserts.assertEQ(events.size(), 1); RecordedEvent event = events.get(0); @@ -169,7 +170,7 @@ Thread.holdsLock(l); recording.stop(); - List events = getRevocationEvents(recording, "lockClass", MyLock.class); + List events = getRevocationEvents(recording, EventNames.BiasedLockSelfRevocation, "lockClass", MyLock.class); Asserts.assertEQ(events.size(), 1); RecordedEvent event = events.get(0); @@ -211,7 +212,7 @@ touch(l); recording.stop(); - List events = getRevocationEvents(recording, "lockClass", MyLock.class); + List events = getRevocationEvents(recording, EventNames.BiasedLockRevocation, "lockClass", MyLock.class); Asserts.assertEQ(events.size(), 1); RecordedEvent event = events.get(0); @@ -237,7 +238,7 @@ Thread biasBreaker1 = triggerRevocation(BULK_REVOKE_THRESHOLD, MyLock.class); recording.stop(); - List events = getRevocationEvents(recording, "revokedClass", MyLock.class); + List events = getRevocationEvents(recording, EventNames.BiasedLockClassRevocation, "revokedClass", MyLock.class); Asserts.assertEQ(events.size(), 2); // The rebias event should occur before the noRebias one