This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 81813c28fc Fix
MultiNodesOfflineClusterIntegrationTest.testServerHardFailure() (#10909)
81813c28fc is described below
commit 81813c28fc53b7f624cd836d0d0abec20cb9d277
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Wed Jun 14 12:51:22 2023 -0700
Fix MultiNodesOfflineClusterIntegrationTest.testServerHardFailure() (#10909)
---
.../MultiNodesOfflineClusterIntegrationTest.java | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiNodesOfflineClusterIntegrationTest.java
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiNodesOfflineClusterIntegrationTest.java
index 7b5561dc71..1e15ce302c 100644
---
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiNodesOfflineClusterIntegrationTest.java
+++
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiNodesOfflineClusterIntegrationTest.java
@@ -19,8 +19,6 @@
package org.apache.pinot.integration.tests;
import com.fasterxml.jackson.databind.JsonNode;
-import java.time.Duration;
-import java.time.temporal.ChronoUnit;
import java.util.Collections;
import java.util.Map;
import org.apache.helix.model.ExternalView;
@@ -158,13 +156,16 @@ public class MultiNodesOfflineClusterIntegrationTest
extends OfflineClusterInteg
serverStarter.stop();
serverStarter = startOneServer(NUM_SERVERS - 1);
_serverStarters.set(NUM_SERVERS - 1, serverStarter);
- TestUtils.waitForCondition(() -> {
- JsonNode queryResult = postQuery("SELECT COUNT(*) FROM mytable");
- // Result should always be correct
-
assertEquals(queryResult.get("resultTable").get("rows").get(0).get(0).longValue(),
getCountStarResult());
- return queryResult.get("numServersQueried").intValue() == NUM_SERVERS;
- }, 10_000L, 1000L, "Failed to include the restarted server into the
routing. Other tests may be affected",
- true, Duration.of(1, ChronoUnit.SECONDS));
+ TestUtils.waitForCondition((aVoid) -> {
+ try {
+ JsonNode queryResult = postQuery("SELECT COUNT(*) FROM mytable");
+ // Result should always be correct
+
assertEquals(queryResult.get("resultTable").get("rows").get(0).get(0).longValue(),
getCountStarResult());
+ return queryResult.get("numServersQueried").intValue() ==
NUM_SERVERS;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }, 10_000L, "Failed to include the restarted server into the routing.
Other tests may be affected");
}
}
@@ -179,10 +180,9 @@ public class MultiNodesOfflineClusterIntegrationTest
extends OfflineClusterInteg
JsonNode firstException = exceptions.get(0);
assertEquals(firstException.get("errorCode").intValue(),
QueryException.BROKER_REQUEST_SEND_ERROR_CODE);
String firstExceptionMessage = firstException.get("message").textValue();
- if (!firstExceptionMessage.contains("Connection refused")) {
- LOGGER.warn("first exception message is " + firstExceptionMessage + ",
which does not contain "
- + "\"Connection refused\"");
- }
+ assertTrue(
+ firstExceptionMessage.contains("Connection refused") ||
firstExceptionMessage.contains("Connection reset"),
+ "Got unexpected first exception message: " + firstExceptionMessage);
JsonNode secondException = exceptions.get(1);
assertEquals(secondException.get("errorCode").intValue(),
QueryException.SERVER_NOT_RESPONDING_ERROR_CODE);
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]