Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(recordings): Add recording options itests #626

Merged
merged 6 commits into from
Aug 6, 2021

Conversation

jan-law
Copy link
Contributor

@jan-law jan-law commented Aug 5, 2021

Related #474

Tests successful scenarios for the TargetRecordingOptionsGetHandler, TargetRecordingOptionsPatchHandler, and the TargetRecordingOptionsListGetHandler.

@andrewazores
Copy link
Member

Tests look good. Do you still observe #263? Either way, I think it would be worth writing some tests to capture that behaviour.

@jan-law
Copy link
Contributor Author

jan-law commented Aug 5, 2021

Do you still observe #263?

Yes, new recordings are created with toDisk=true.
Should recordings write to disk by default? If you'd like, I could change the default options to return toDisk=true.

@andrewazores
Copy link
Member

The default should be whatever the target JVM says it is, which according to docs, seems it should be true. #263 seems to reflect a bug in JMC code, then, where the recording options map contains false when it would be expected to be true or perhaps null (unset, as the docs say).

});

JsonObject expectedGetResponse =
new JsonObject(Map.of("maxAge", 0, "toDisk", false, "maxSize", 0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put a FIXME here with a link to #263? That's still something we should probably investigate further, although I am fairly convinced that it's just a JMC bug with how those OptionDescriptors are created or how the toDisk setting is read from the JVM.

Copy link
Member

@andrewazores andrewazores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good otherwise.

andrewazores
andrewazores previously approved these changes Aug 6, 2021
@jan-law
Copy link
Contributor Author

jan-law commented Aug 6, 2021

RecordingWorkflowIT failed at the part where it expects the in-memory jfr file to be larger than the saved jfr file. Why would it fail this time but pass most of the time? I'm re-running the tests to see what happens

Error:  Failures: 
Error:    RecordingWorkflowIT.testWorkflow:222 
Expected: a value greater than <9919>
but: <8305> was less than <9919>

@jan-law
Copy link
Contributor Author

jan-law commented Aug 6, 2021

Hmm, now AutoRulesIT is failing because I forgot to reset the default recording options. Let me fix that

Error:  Failures: 
Error:    AutoRulesIT.testNewContainerHasRuleApplied:285 
Expected: <0>
     but: was <1000>

@andrewazores
Copy link
Member

RecordingWorkflowIT failed at the part where it expects the in-memory jfr file to be larger than the saved jfr file. Why would it fail this time but pass most of the time? I'm re-running the tests to see what happens

Error:  Failures: 
Error:    RecordingWorkflowIT.testWorkflow:222 
Expected: a value greater than <9919>
but: <8305> was less than <9919>

Hmm. It sounds like it could simply be that the in-memory ring buffers filled up and some older event data was dropped in between the two recordings being retrieved, assuming that the recording isn't somehow configured with a maximum event age.

It's not a good fix, but changing the template in that test from ALL to just Continuous should cut down the number of events recorded and hopefully work around this edge case. Could you file a bug for this failure with a link to the CI log and whatever other findings you may have?

@andrewazores
Copy link
Member

Hmm, now AutoRulesIT is failing because I forgot to reset the default recording options. Let me fix that

Error:  Failures: 
Error:    AutoRulesIT.testNewContainerHasRuleApplied:285 
Expected: <0>
     but: was <1000>

Aha - that would do it. maxSize=1000 in your 4th test case would be likely to cause the behaviour I described in the last comment, or at least cause it to occur much earlier/more frequently.

@andrewazores andrewazores merged commit 6eeb85c into cryostatio:main Aug 6, 2021
@jan-law jan-law deleted the itest-recording-options branch August 6, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants