Skip to content

Conversation

@EdColeman
Copy link
Contributor

This is a subset (and supersedes) #3202 and focuses on replacements only in test code.

  • replace occurrences of sleepUninterruptibly with Thread.sleep()
  • prefer static import of TimeUnits instead of using TimeUnit.[UNIT] in files that had changes.

Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

Mostly okay with these changes, though I don't think most of them matter much, because we're not in the habit of interrupting threads in our test classes or killing the tests... if we do, it's likely we're just killing the entire test to start all over, so having the code try to deal with the interruption isn't really worth it. In a few cases, I think it would be cleaner to allow the InterruptedException to fall through the @Test methods rather than bother trying to handle them.

My favorite thing about these changes, though, is the static imports of the TimeUnit types, which is much more readable.

@EdColeman EdColeman merged commit ae79a2a into apache:main Mar 7, 2023
@EdColeman EdColeman deleted the remove_sleepUninterruptibly_from_tests branch March 7, 2023 13:41
@ctubbsii ctubbsii added this to the 3.0.0 milestone Jul 12, 2024
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