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

Use LockSupport.parkNanos instead of Thread.sleep in systemtests #10522

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

kornys
Copy link
Contributor

@kornys kornys commented Aug 30, 2024

Type of change

  • Refactoring

Description

Use LockSupport.parkNanos instead of Thread.sleep when we need to wait in systemtests.

The use of LockSupport.parkNanos is more consistent with modern concurrency practices in Java, where fine-grained control over thread states is often required. This change aligns the codebase with best practices for implementing efficient concurrency mechanisms.

Unlike Thread.sleep, LockSupport.parkNanos does not throw an InterruptedException but instead returns immediately if the thread is interrupted.

And also my IDE does not warn me with Thread.sleep :D

Checklist

  • Make sure all tests pass

@kornys
Copy link
Contributor Author

kornys commented Aug 30, 2024

/packit test --labels regression

@kornys kornys self-assigned this Aug 30, 2024
@kornys kornys added this to the 0.44.0 milestone Aug 30, 2024
@kornys kornys changed the title Use LockSupport.partNanos instead of Thread.sleep in systemtests Use LockSupport.parkNanos instead of Thread.sleep in systemtests Aug 30, 2024
@kornys kornys marked this pull request as ready for review August 30, 2024 16:11
@im-konge im-konge requested a review from a team August 30, 2024 19:30
@im-konge im-konge requested review from Frawless and see-quick August 30, 2024 19:31
@scholzj
Copy link
Member

scholzj commented Aug 31, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Frawless Frawless requested a review from scholzj September 4, 2024 06:52
@scholzj
Copy link
Member

scholzj commented Sep 4, 2024

Maybe the description should explain why it is being done?

@kornys
Copy link
Contributor Author

kornys commented Sep 5, 2024

Maybe the description should explain why it is being done?

done

@kornys kornys added the ready for merge Label for PRs which are ready for merge label Sep 5, 2024
@scholzj scholzj merged commit 5ddb18e into strimzi:main Sep 5, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for merge Label for PRs which are ready for merge System tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants