Jackie-Jiang 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_r260101197
##########
File path:
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/PinotURIUploadIntegrationTest.java
##########
@@ -186,6 +186,38 @@ 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)
+ throws Exception {
+ 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;
+ File segmentTarDir = generateRandomSegment(segment6, nRows1);
+ try {
+ uploadSegmentsDirectly(segmentTarDir);
+ Assert.fail("Uploading segments should fail.");
+ } catch (Exception e) {
+ Assert.assertNotNull(e);
+ Assert.assertTrue(e.getMessage().contains("No assigned Instances for
Segment"));
Review comment:
Don't check the exception message content. We might change the exception
message in the future and that should not fail the test. The fail() in try
block should be enough
----------------------------------------------------------------
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]