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

[MINOR] fix(test): Fix flaky test SimpleClusterManagerTest#updateExcludeNodesTest #2331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maobaolong
Copy link
Member

What changes were proposed in this pull request?

Fix flaky test SimpleClusterManagerTest#updateExcludeNodesTest

Why are the changes needed?

Error:  Tests run: 10, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.317 s <<< FAILURE! - in org.apache.uniffle.coordinator.SimpleClusterManagerTest
Error:  getUnhealthyServerList  Time elapsed: 0.633 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <[sn4, sn2, sn1]> but was: <[sn2, sn1, sn4, sn3]>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1141)
	at org.apache.uniffle.coordinator.SimpleClusterManagerTest.getUnhealthyServerList(SimpleClusterManagerTest.java:219)

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing UT

Copy link

github-actions bot commented Jan 8, 2025

Test Results

 2 966 files  ±0   2 966 suites  ±0   6h 28m 59s ⏱️ + 1m 34s
 1 100 tests ±0   1 098 ✅ ±0   2 💤 ±0  0 ❌ ±0 
13 774 runs  ±0  13 744 ✅ ±0  30 💤 ±0  0 ❌ ±0 

Results for commit e611f03. ± Comparison against base commit c14bff7.

Copy link
Collaborator

@cchung100m cchung100m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a workaround solution here?

@maobaolong
Copy link
Member Author

Is it a workaround solution here?

@cchung100m Thanks for your review! Actually, no. The purpose of sleep here is specifically to ensure that the file modification time exceeds one second, allowing the subsequent logic to detect a change in the modification time.

@@ -451,6 +451,8 @@ public void updateExcludeNodesTest() throws Exception {
remainNodes, availableNodes.stream().map(ServerNode::getId).collect(Collectors.toSet()));

final Set<String> nodes2 = Sets.newHashSet("node3-1999", "node4-1999");
// Make sure last modification time change
Thread.sleep(1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use Awaitility.await() instead of sleep? We should wait for a condition instead of a fixed interval.

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.

3 participants