GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use Thread.join instead of sleep in WaitTest by therealemmanueloppong · Pull Request #4971 · kubernetes-client/java

Conversation

@therealemmanueloppong

@therealemmanueloppong therealemmanueloppong commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notes

Thank you for maintaining this project.

WaitTest.pollShutsDownExecutorThreadAfterReturning waits for the worker thread to terminate with a hand-written loop that calls Thread.sleep(10) between isAlive() checks, up to a 2 second deadline. Thread.join(2000) waits for exactly that event with the same upper limit, so the loop and the Thread.sleep can go away.

Behaviour is unchanged: the test still waits up to 2 seconds for the worker to stop and then asserts that it is no longer alive. This is a small cleanup and not a speed-up, since the test already finished in well under 0.1 seconds. I only changed this one test file.

Related issue

Part of #1223

Testing

  • WaitTest passes (ran it 3 times).
  • mvn spotless:check passes for the util module.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@therealemmanueloppong
Use Thread.join instead of sleep in WaitTest
4c05154
pollShutsDownExecutorThreadAfterReturning waited for the worker thread
to stop with a hand-written loop that slept 10 ms between checks. Use
Thread.join with the same 2 second limit, which waits for exactly the
event the test cares about and removes the Thread.sleep.

Part of kubernetes-client#1223.
@kubernetes-prow
kubernetes-prow Bot requested review from brendandburns and yue9944882 November 1, 2026 14:18
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 1, 2026
@brendandburns

brendandburns commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kubernetes-prow kubernetes-prow Bot assigned brendandburns Nov 5, 2026
@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 5, 2026
@kubernetes-prow

kubernetes-prow Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, therealemmanueloppong

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [brendandburns]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 5, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 6b1472f into kubernetes-client:master Nov 5, 2026
14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brendandburns brendandburns Awaiting requested review from brendandburns
@yue9944882 yue9944882 Awaiting requested review from yue9944882

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@brendandburns brendandburns

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@therealemmanueloppong @brendandburns
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.