RFR: 8266410: jdk/jfr/javaagent/TestLoadedAgent.java failed with "Mismatch in TestEvent count"

Erik Gahlin egahlin at openjdk.java.net
Wed Jan 19 11:14:44 UTC 2022


Hi,

Could I have a review of a test fix.

The test emits a lot of data in a short period of time. On my machine about 35 MB/s, which should be fine in most cases, but could potentially lead to events being dropped. I could reproduce the issue, with 4% of all events being dropped and with jdk.DataLoss events in the recording, if increased the number of events significantly. 

Contributing to the flakiness is the default recording and its periodic events that uses buffers at the same time. I think it is fine to run with the default recording, as it is more realistic, but we should not do so with too many events emitted per second. Purpose of the test is not to stress the buffer system, but to see we can load JFR with a Java agent (with some user-defined events).

I changed the test so it doesn't read all event into memory  to make it easier to reproduce the issue without using too much RAM. I choose not to use EventStream.openFile(Path), because we might want to run this with JDK 11 where event streaming is not available. I printed the recording size and any dataloss events to make it easier to diagnose if it should reoccur.

Testing: jdk/jdk/jfr/javaagent/* 100 times

Thanks
Erik

-------------

Commit messages:
 - Initial

Changes: https://git.openjdk.java.net/jdk/pull/7141/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7141&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8266410
  Stats: 18 lines in 1 file changed: 13 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7141.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7141/head:pull/7141

PR: https://git.openjdk.java.net/jdk/pull/7141


More information about the hotspot-jfr-dev mailing list