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

Replace Sleep with While Loop in WorkerPoolTest #5

Closed
wants to merge 6 commits into from

Conversation

CodeLtDave
Copy link
Owner

Summary:
Replaced a 5-second sleep used to wait for worker threads to become idle in the WorkerPoolTest with a while loop. This change includes a timeout of 5 seconds to check when there are fewer than 50 workers, making the test more responsive and reliable.

Changes:

  • Removed the Thread.sleep(5 * 1000L); line that was used to wait until worker threads become idle.
  • Added a while loop with a 5-second timeout to actively check for the condition of fewer than 50 active worker threads.
  • Updated test annotations.

Benefits:
This change makes the test more robust by actively checking the condition instead of relying on a fixed sleep time. It also aligns with the modern testing approach and ensures the test does not hang indefinitely.

jukzi and others added 4 commits August 8, 2023 15:36
One should use proper data structures to maintain a list of listeners.

Fixes eclipse-platform#613
Deleted useless test class Good.java because the test is trivial. Furthermore the package org.eclipse.tips.tests was also deleted because it is empty now.
Contributes to eclipse-platform#525.
Summary:
Replaced a 5-second sleep used to wait for worker threads to become idle in the WorkerPoolTest with a while loop. This change includes a timeout of 5 seconds to check when there are fewer than 50 workers, making the test more responsive and reliable.

Changes:
- Removed the `Thread.sleep(5 * 1000L);` line that was used to wait until worker threads become idle.
- Added a while loop with a 5-second timeout to actively check for the condition of fewer than 50 active worker threads.
- Updated test annotations.

Benefits:
This change makes the test more robust by actively checking the condition instead of relying on a fixed sleep time. It also aligns with the modern testing approach and ensures the test does not hang indefinitely.
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.

4 participants