walterddr commented on code in PR #11806:
URL: https://github.com/apache/pinot/pull/11806#discussion_r1359922388
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTestSet.java:
##########
@@ -605,40 +607,47 @@ private void checkForEmptyRoutingTable(boolean
shouldBeEmpty) {
}, 60_000L, errorMessage);
}
- public void testReset(TableType tableType)
- throws Exception {
+ public void testReset(TableType tableType) {
String rawTableName = getTableName();
+ String tableNameWithType =
TableNameBuilder.forType(tableType).tableNameWithType(rawTableName);
- // reset the table.
- resetTable(rawTableName, tableType, null);
-
- // wait for all live messages clear the queue.
- List<String> instances =
_helixResourceManager.getServerInstancesForTable(rawTableName, tableType);
- PropertyKey.Builder keyBuilder = _helixDataAccessor.keyBuilder();
+ // Reset the table.
+ // NOTE: Reset table might fail if there are pending messages, so we need
to retry until it succeeds.
TestUtils.waitForCondition(aVoid -> {
- int liveMessageCount = 0;
- for (String instanceName : instances) {
- List<Message> messages =
_helixDataAccessor.getChildValues(keyBuilder.messages(instanceName), true);
- liveMessageCount += messages.size();
+ try {
+ resetTable(rawTableName, tableType, null);
+ return true;
+ } catch (IOException e) {
+ assertTrue(e.toString().contains("pending message"));
Review Comment:
add an assert msg? (expected pending message exception during reset, but
found 'e')..
otherwise error msg will only be "false" for this test.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]