TestLatestEvent: Abort if not 6 NotLatest events are found JEP-349-branch
authoregahlin
Mon, 28 Oct 2019 21:31:23 +0100
branchJEP-349-branch
changeset 58828 4dc714767d69
parent 58827 dfcbce79747b
child 58837 2bfbb50dd97d
TestLatestEvent: Abort if not 6 NotLatest events are found
test/jdk/jdk/jfr/api/consumer/streaming/TestLatestEvent.java
--- a/test/jdk/jdk/jfr/api/consumer/streaming/TestLatestEvent.java	Mon Oct 28 21:24:30 2019 +0100
+++ b/test/jdk/jdk/jfr/api/consumer/streaming/TestLatestEvent.java	Mon Oct 28 21:31:23 2019 +0100
@@ -105,10 +105,10 @@
             notLatestEvent.await(80, TimeUnit.SECONDS);
             if (notLatestEvent.getCount() != 0) {
                Recording rec =  FlightRecorder.getFlightRecorder().takeSnapshot();
-               Path p = Paths.get("c:\\testlatest\\not-latest.jfr");
+               Path p = Paths.get("error-not-latest.jfr").toAbsolutePath();
                rec.dump(p);
-               System.out.println("dumped " + p);
-               rec.close();
+               System.out.println("Dumping repository as a file for inspection at " + p);
+               throw new Exception("Timeout 80 s. Expected 6 event, but got "  + notLatestEvent.getCount());
             }
 
             try (EventStream s = EventStream.openRepository()) {