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

bugfix: fix flakey test, avoid early finalization #13095

Merged
merged 1 commit into from
May 10, 2024

Conversation

itschrispeck
Copy link
Collaborator

@itschrispeck itschrispeck commented May 7, 2024

Addresses a flakey test issue noticed by @Jackie-Jiang here. Also addresses other tests that could be flakey for the same reason.

For background, see: https://julien.ponge.org/blog/not-all-java-single-threaded-executors-are-created-equal-a-java-finalizer-horror-story/ and https://bugs.openjdk.org/browse/JDK-8145304. Executors.newSingleThreadExecutor can only be used in this manner safely in Java 21+.

Also verified that non-test code using Executors.newSingleThreadExecutor looks safe.

tags: bugfix

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.19%. Comparing base (59551e4) to head (3726469).
Report is 409 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13095      +/-   ##
============================================
+ Coverage     61.75%   62.19%   +0.44%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2507      +71     
  Lines        133233   137785    +4552     
  Branches      20636    21328     +692     
============================================
+ Hits          82274    85697    +3423     
- Misses        44911    45697     +786     
- Partials       6048     6391     +343     
Flag Coverage Δ
custom-integration1 <0.01% <ø> (-0.01%) ⬇️
integration <0.01% <ø> (-0.01%) ⬇️
integration1 <0.01% <ø> (-0.01%) ⬇️
integration2 0.00% <ø> (ø)
java-11 35.33% <ø> (-26.38%) ⬇️
java-21 62.06% <ø> (+0.43%) ⬆️
skip-bytebuffers-false 62.15% <ø> (+0.41%) ⬆️
skip-bytebuffers-true 62.03% <ø> (+34.30%) ⬆️
temurin 62.19% <ø> (+0.44%) ⬆️
unittests 62.19% <ø> (+0.44%) ⬆️
unittests1 46.85% <ø> (-0.04%) ⬇️
unittests2 27.76% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@yashmayya yashmayya left a comment

Choose a reason for hiding this comment

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

Nice find!

@Jackie-Jiang Jackie-Jiang merged commit c77a65d into apache:master May 10, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants