Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ public void testReconfigureNodeMax() throws Exception {
assertEquals(5, info.getServerToPartitionRanges().keySet().size());

// case3: recover its value to 10
Thread.sleep(1000L);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should Awaitility.await.

Copy link
Member Author

@maobaolong maobaolong Jan 8, 2025

Choose a reason for hiding this comment

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

@jerqi I added a new comment above this line. This sleep to make sure the last modification time of the tempConfFilePath file changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

You wait for a modification timestamp instead sleep.

try (FileWriter fileWriter = new FileWriter(tempConfFilePath)) {
fileWriter.append(CoordinatorConf.COORDINATOR_SHUFFLE_NODES_MAX.key() + " " + 10);
}
Thread.sleep(1000L);
Awaitility.await().timeout(2, TimeUnit.SECONDS).until(() -> nodeMax.get() == 10);
info = shuffleWriteClient.getShuffleAssignments("app1", 0, 10, 1, TAGS, SERVER_NUM + 10, -1);
assertEquals(10, info.getServerToPartitionRanges().keySet().size());
Expand Down
Loading