Skip to content

Commit

Permalink
Fix the test failures caused by instance drop failure (apache#12002)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackie-Jiang authored Nov 14, 2023
1 parent 7217bb9 commit 62abf1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ public void stopFakeInstance(String instanceId) {

public void stopAndDropFakeInstance(String instanceId) {
stopFakeInstance(instanceId);
_helixResourceManager.dropInstance(instanceId);
TestUtils.waitForCondition(aVoid -> _helixResourceManager.dropInstance(instanceId).isSuccessful(), 60_000L,
"Failed to drop fake instance: " + instanceId);
}

public static Schema createDummySchema(String tableName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void testGetDataInstanceAdminEndpoints()
}, 60_000L, "Failed to update the admin port");

// Remove the new added server
_helixResourceManager.dropInstance(serverName);
assertTrue(_helixResourceManager.dropInstance(serverName).isSuccessful());
TestUtils.waitForCondition(aVoid -> {
try {
_helixResourceManager.getDataInstanceAdminEndpoints(Collections.singleton(serverName));
Expand Down Expand Up @@ -220,7 +220,7 @@ public void testAddRemoveInstance() {
assertTrue(allInstances.contains(instanceName));

// Remove the added instance
_helixResourceManager.dropInstance(instanceName);
assertTrue(_helixResourceManager.dropInstance(instanceName).isSuccessful());
allInstances = _helixResourceManager.getAllInstances();
assertFalse(allInstances.contains(instanceName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,11 @@ public void testRebalance()
waitForRebalanceToComplete(rebalanceResult, 600_000L);
waitForAllDocsLoaded(600_000L);

_resourceManager.disableInstance(serverStarter1.getInstanceId());
_resourceManager.disableInstance(serverStarter2.getInstanceId());

_resourceManager.dropInstance(serverStarter1.getInstanceId());
_resourceManager.dropInstance(serverStarter2.getInstanceId());

serverStarter1.stop();
serverStarter2.stop();
TestUtils.waitForCondition(aVoid -> _resourceManager.dropInstance(serverStarter1.getInstanceId()).isSuccessful()
&& _resourceManager.dropInstance(serverStarter2.getInstanceId()).isSuccessful(), 60_000L,
"Failed to drop servers");
}

@Test
Expand Down

0 comments on commit 62abf1f

Please sign in to comment.