RFR(S): 8223217: [TESTBUG] Create JFR tests with JMX across container boundary

Mikhailo Seledtsov mikhailo.seledtsov at oracle.com
Wed Dec 4 18:02:37 UTC 2019


Hi Erik,

   Thank you for reviewing the test, and thanks for recommendations. I 
will make the updates according to your recommendations, and will post 
updated webrev after some testing.


Misha

On 12/3/19, 11:46 AM, Erik Gahlin wrote:
> Hi Misha,
>
> Looks good overall, but it seems brittle to expect that the test will 
> finish within the 10 s the EvenyGenerator runs
>
> Maybe you could make it deterministic by (for example) checking if the 
> recording has stopped:
>
> int i = 0;
> while (true) {
>     SimpleEvent event = new SimpleEvent();
>     event.msg = "Hello";
>     event.count = i++;
>     event.commit();
>     Thread.sleep(10);
>     if (FlightRecorder.isInitialized()) {
>         for (Recording r : 
> FlightRecorder.getFlightRecorder().getRecordings()) {
>             if (r.getState() == RecordingState.STOPPED) {
>                 System.exit(0);
>             }
>         }
>     }
> }
>
> and then not close the recording in the test?
>
> The test could also be made a bit more realistic if you run a default 
> recording
>
> bean.setPredefinedConfiguration(recordingId, "default");
>
> Thanks
> Erik
>
>
>
> On 2019-12-03 05:06, mikhailo.seledtsov at oracle.com wrote:
>> Please review this change that tests JFR operations across container 
>> boundary while using JMX to control JFR.
>> The test starts a container running a simple event producer, 
>> establishes a JMX connection, uses FlightRecorderMXBean to start the 
>> recording, stop and dump the recording, then transfers recording from 
>> the container.
>> Simple verification is performed on the transferred recording, making 
>> sure that the expected test event is present.
>>
>>     JBS: https://bugs.openjdk.java.net/browse/JDK-8223217
>>     Webrev: http://cr.openjdk.java.net/~mseledtsov/8223217.01/
>>     Testing:
>>         1. Ran the newly created test at least 30 times on a 
>> Linux-x64 host with docker engine configured - PASSED
>>         2. Ran the test at least 20 times on a test cluster: ALL PASS
>>         3. Ran all hotspot/containers tests on the test cluster: PASS
>>
>>
>> Thank you,
>> Misha
>>


More information about the hotspot-jfr-dev mailing list