Skip to content

HDDS-15292. Reduce Thread.sleep usage in DiskBalancer tests.#10293

Open
slfan1989 wants to merge 1 commit into
apache:masterfrom
slfan1989:HDDS-15292
Open

HDDS-15292. Reduce Thread.sleep usage in DiskBalancer tests.#10293
slfan1989 wants to merge 1 commit into
apache:masterfrom
slfan1989:HDDS-15292

Conversation

@slfan1989
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR reduces fixed Thread.sleep usage in DiskBalancer tests.

Some DiskBalancer tests used fixed sleeps to wait for asynchronous state changes or delayed cleanup. Fixed waits can make tests slower than necessary and may also introduce flakiness on slow or busy CI machines.

This change replaces those sleeps with condition-based waits using GenericTestUtils.waitFor, so the tests continue as soon as the expected condition is met and fail with a timeout if it is not reached.

Specifically, the tests now wait for explicit conditions such as:

  • delayed replica deletion becoming eligible;
  • container deletion completion;
  • pending deletion block count changes;
  • container state transitions to UNHEALTHY or CLOSED.

What is the link to the Apache JIRA

JIRA: HDDS-15292. Reduce Thread.sleep usage in DiskBalancer tests.

How was this patch tested?

Add Junit Test.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants