jackjlli commented on a change in pull request #3856: Check assigned instances 
for uploading new segment
URL: https://github.com/apache/incubator-pinot/pull/3856#discussion_r259218354
 
 

 ##########
 File path: 
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/PinotURIUploadIntegrationTest.java
 ##########
 @@ -186,6 +187,34 @@ private void verifyNRows(int currentNrows, int finalNrows)
     Assert.fail("Failed to get from " + currentNrows + " to " + finalNrows);
   }
 
+  @Test(dataProvider = "configProvider")
+  public void testSegmentValidator(String tableName, SegmentVersion version) {
+    completeTableConfiguration();
+    String serverInstanceId = "Server_localhost_" + 
CommonConstants.Helix.DEFAULT_SERVER_NETTY_PORT;
+
+    // Disable server instance.
+    _helixAdmin.enableInstance(getHelixClusterName(), serverInstanceId, false);
+
+    final String segment6 = "segmentToBeRefreshed_6";
+    final int nRows1 = 69;
+    try {
+      generateAndUploadRandomSegment(segment6, nRows1);
+      Assert.fail("Uploading segments should fail.");
+    } catch (Exception e) {
+      Assert.assertNotNull(e);
+      Assert.assertTrue(e.getMessage().contains("No assigned Instances for 
Segment"));
+    }
+
+    // Re-enable the server instance.
+    _helixAdmin.enableInstance(getHelixClusterName(), serverInstanceId, true);
+
+    try {
+      generateAndUploadRandomSegment(segment6, nRows1);
 
 Review comment:
   Done.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to