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

RANGER-5153: fix for intermittent unit test failure in RangerJSONAuditWriterTest #536

Merged
merged 2 commits into from
Feb 22, 2025

Conversation

mneethiraj
Copy link
Contributor

What changes were proposed in this pull request?

The test checks for null value for AbstractRangerAuditWriter.logWriter in the main test thread. This member is updated in antoher thread that periodically looks to close the audit file. AbstractRangerAuditWriter.logWriter is now made vollatile so that updated value is visible in the main test thread.

How was this patch tested?

Build with unit tests completed successfully.

Copy link
Contributor

@kumaab kumaab left a comment

Choose a reason for hiding this comment

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

LGTM.

@mneethiraj mneethiraj merged commit 324d5db into apache:master Feb 22, 2025
3 checks passed
mneethiraj added a commit that referenced this pull request Feb 22, 2025
if (CollectionUtils.isEmpty(events)) {
closeFileIfNeeded();
} else {
out1 = getLogFileStream();
Copy link
Contributor

Choose a reason for hiding this comment

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

you can reduce the scope of out1 to else block .

Copy link
Contributor

@vyommani vyommani left a comment

Choose a reason for hiding this comment

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

Looks OK to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants