Skip to content

Replace Thread.sleep with Wait.waitFor in FailoverClusterTest#1679

Open
jeanouii wants to merge 1 commit intoapache:mainfrom
jeanouii:fix/AutoFailoverClusterTest
Open

Replace Thread.sleep with Wait.waitFor in FailoverClusterTest#1679
jeanouii wants to merge 1 commit intoapache:mainfrom
jeanouii:fix/AutoFailoverClusterTest

Conversation

@jeanouii
Copy link
Contributor

Thread.sleep(3000) is unreliable on slow CI machines for waiting on cluster formation and client rebalancing. Replace all sleep-based synchronization with Wait.waitFor polling:

  • testClusterConnectedAfterClients: poll for clients on multiple brokers
  • testClusterURIOptionsStrip: same polling for client rebalance
  • testClusterConnectedBeforeClients: poll for bridge formation, then poll for client failover after broker stop

This also fixes AutoFailoverClusterTest which inherits these methods.

Thread.sleep(3000) is unreliable on slow CI machines for waiting on cluster formation and client rebalancing. Replace all sleep-based synchronization with Wait.waitFor polling:
- testClusterConnectedAfterClients: poll for clients on multiple brokers
- testClusterURIOptionsStrip: same polling for client rebalance
- testClusterConnectedBeforeClients: poll for bridge formation, then poll for client failover after broker stop

This also fixes AutoFailoverClusterTest which inherits these methods.
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.

1 participant