replace busy wait loop with Thread.sleep in WaitUtil#501
Merged
Conversation
4496462 to
5971189
Compare
| * @author Frank Giordano | ||
| * @version 6.0 | ||
| */ | ||
| public class TimerTest { |
Collaborator
There was a problem hiding this comment.
I think we should delete timer class which makes this class unnecessary.
| /** | ||
| * Class containing unit tests for WaitUtil. | ||
| * | ||
| * @author Frank Giordano |
Collaborator
There was a problem hiding this comment.
You can use your name.
frankgiordano
requested changes
May 26, 2026
…utilization during wait times Signed-off-by: chaitanya <chaitanyakatore@gmail.com>
5971189 to
1f2718a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR optimizes the
WaitUtil.waithelper by replacing an inefficient CPU busy-wait loop withThread.sleep(). It also cleans up the codebase by removing the unusedTimerclass and introduces unit tests forWaitUtil.Changes Made
WaitUtil.javato useThread.sleep()and handle theInterruptedExceptioninternally. This frees up the CPU during wait operations (used byJobMonitorandUssCmd).Timer.javaandTimerTest.javasince theTimerclass is no longer utilized anywhere in the codebase.WaitUtilTest.javaundersrc/test/java/zowe/client/sdk/utility/timer/to test wait-duration blocking and validate utility class structure (author set to Chaitanya Katore).package-info.javato reflect the removal of theTimerclass.Verification
./mvnw testto execute the full test suite.BUILD SUCCESSTimerTestand addition ofWaitUtilTest), Failures: 0, Errors: 0, Skipped: 0