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

[Java] Flakey test TestBaseAllocator#testMemoryUsage #36340

Closed
laurentgo opened this issue Jun 28, 2023 · 0 comments · Fixed by #36341
Closed

[Java] Flakey test TestBaseAllocator#testMemoryUsage #36340

laurentgo opened this issue Jun 28, 2023 · 0 comments · Fixed by #36341

Comments

@laurentgo
Copy link
Contributor

Describe the bug, including details regarding any error messages, version, and platform.

Test introduced by #35314 is flakey, and result in log messages not being detected.

In an attempt to debug it by adding the list of log messages, the following output is observed:

Error:  Failures: 
Error:    TestBaseAllocator.testMemoryUsage:1127 Log messages are:
[TRACE] Memory Usage: 
null

The only possible explanation is that there's a side effect of the logging thread being started before the allocator field of the parent class being set and observable yet

Component(s)

Java

laurentgo added a commit to laurentgo/arrow that referenced this issue Jun 28, 2023
Address a race condition where the allocator logger thread starts
logging before the class is fully initialized

Change initialization order within the allocator to address the race
condition.

Add list of log messages captured during the test run if the assertion
failed.

Yes.

No.

Closes apache#36340
laurentgo added a commit to laurentgo/arrow that referenced this issue Jun 28, 2023
Address a race condition where the allocator logger thread starts
logging before the class is fully initialized

Change initialization order within the allocator to address the race
condition.

Add list of log messages captured during the test run if the assertion
failed.

Yes.

No.

Closes apache#36340
lidavidm pushed a commit that referenced this issue Jun 28, 2023
…36341)

### Rationale for this change
Address a race condition where the allocator logger thread starts logging before the class is fully initialized

### What changes are included in this PR?
Change initialization order within the allocator to address the race condition.

Add list of log messages captured during the test run if the assertion failed.

### Are these changes tested?
Yes.

### Are there any user-facing changes?
No.

Closes #36340
* Closes: #36340

Authored-by: Laurent Goujon <laurent@apache.org>
Signed-off-by: David Li <li.davidm96@gmail.com>
@lidavidm lidavidm added this to the 13.0.0 milestone Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants