Skip to content

Conversation

@nadavramon
Copy link

This PR addresses issue #7391 by removing arbitrary Thread.sleep() calls in the test suite to reduce flakiness and improve test reliability.

Changes:

LeaderElectorTest.java: Replaced fixed sleeps in loopCancel with Awaitility to verify counter stability deterministically.

LeaderElectorTest.java: Updated shouldStopOnReleaseWhenCanceled to use a generic KubernetesClientException constructor, bypassing local model-compilation issues while maintaining test logic.

SerialExecutorTest.java: Replaced Thread.sleep and polling loops in clearInterrupt and taskExecutedInOrderOfInsertion with CountDownLatch for precise thread synchronization.

General: Updated method signatures to handle ExecutionException and TimeoutException where necessary for deterministic CompletableFuture.get() calls.

@nadavramon
Copy link
Author

I've refactored all 5 files identified in the issue using Awaitility and CountDownLatch. My local build is currently blocked by missing 7.5-SNAPSHOT model dependencies, but the logic follows the requested deterministic patterns. Please let the CI verify the stability.

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