You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/04/04 19:35:42 UTC

[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #4061: Fix 500 issue with 'GET /tenants' API call

mcvsubbu commented on a change in pull request #4061: Fix 500 issue with 'GET /tenants' API call
URL: https://github.com/apache/incubator-pinot/pull/4061#discussion_r272335245
 
 

 ##########
 File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManagerTest.java
 ##########
 @@ -264,6 +264,49 @@ public void testRetrieveMetadata()
     }
   }
 
+  @Test void testRetrieveTenantNames() {
+    // Create broker tenant on 1 Broker
+    Tenant brokerTenant =
+        new Tenant.TenantBuilder(BROKER_TENANT_NAME).setRole(TenantRole.BROKER).setTotalInstances(1).build();
+    _helixResourceManager.createBrokerTenant(brokerTenant);
+
+    Set<String> brokerTenantNames = _helixResourceManager.getAllBrokerTenantNames();
+    Assert.assertEquals(brokerTenantNames.size(), 1);
+    Assert.assertEquals(brokerTenantNames.iterator().next(), BROKER_TENANT_NAME);
+
+    String testBrokerInstance =
+        _helixResourceManager.getAllInstancesForBrokerTenant(BROKER_TENANT_NAME).iterator().next();
+    _helixAdmin.addInstanceTag(_helixClusterName, testBrokerInstance, "wrong_tag");
+
+    brokerTenantNames = _helixResourceManager.getAllBrokerTenantNames();
+    Assert.assertEquals(brokerTenantNames.size(), 1);
+    Assert.assertEquals(brokerTenantNames.iterator().next(), BROKER_TENANT_NAME);
+
+    _helixAdmin.removeInstanceTag(_helixClusterName, testBrokerInstance, "wrong_tag");
+
+    // Untag all Brokers for other tests
+    for (String brokerInstance : _helixResourceManager.getAllInstancesForBrokerTenant(BROKER_TENANT_NAME)) {
 
 Review comment:
   Do you want to add this in an  @AfterTest annotated method?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org