Skip to content

Commit

Permalink
Fix testGetDomainInformation since we no longer allow an instance to …
Browse files Browse the repository at this point in the history
…join the cluster with an invalid DOMAIN field.
  • Loading branch information
zpinto committed Oct 27, 2023
1 parent 4ca8f26 commit aa813a9
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -898,24 +898,28 @@ public void testGetDomainInformation() {
InstanceConfig instanceConfig = new InstanceConfig(instanceName);
instanceConfig.setHostName(hostname);
instanceConfig.setPort(port);
if (i == 40) {
instanceConfig.setDomain(String
.format("invaliddomain=%s,zone=%s,rack=%s,host=%s", "mygroup" + i % 2, "myzone" + i % 4,
"myrack" + i % 4, hostname));
} else if (i == 41) {
instanceConfig.setDomain("invaliddomain");
} else {
String domain = String
.format("group=%s,zone=%s,rack=%s,host=%s", "mygroup" + i % 2, "myzone" + i % 4,
"myrack" + i % 4, hostname);
instanceConfig.setDomain(domain);
}

String domain =
String.format("group=%s,zone=%s,rack=%s,host=%s", "mygroup" + i % 2, "myzone" + i % 4,
"myrack" + i % 4, hostname);
instanceConfig.setDomain(domain);

LiveInstance liveInstance = new LiveInstance(instanceName);
liveInstance.setSessionId(UUID.randomUUID().toString());
liveInstance.setHelixVersion(UUID.randomUUID().toString());
accessor.setProperty(keyBuilder.liveInstance(instanceName), liveInstance);
admin.addInstance(clusterName, instanceConfig);
admin.enableInstance(clusterName, instanceName, true);

if (i == 40) {
instanceConfig.setDomain(
String.format("invaliddomain=%s,zone=%s,rack=%s,host=%s", "mygroup" + i % 2,
"myzone" + i % 4, "myrack" + i % 4, hostname));
admin.setInstanceConfig(clusterName, instanceName, instanceConfig);
} else if (i == 41) {
instanceConfig.setDomain("invaliddomain");
admin.setInstanceConfig(clusterName, instanceName, instanceConfig);
}
}

ClusterTopology clusterTopology = admin.getClusterTopology(clusterName);
Expand Down

0 comments on commit aa813a9

Please sign in to comment.