|
|
@@ -42,6 +42,7 @@ import static org.hamcrest.Matchers.empty;
|
|
|
import static org.hamcrest.Matchers.equalTo;
|
|
|
import static org.hamcrest.Matchers.greaterThan;
|
|
|
import static org.hamcrest.Matchers.in;
|
|
|
+import static org.hamcrest.Matchers.instanceOf;
|
|
|
import static org.hamcrest.Matchers.is;
|
|
|
import static org.hamcrest.Matchers.lessThanOrEqualTo;
|
|
|
import static org.hamcrest.Matchers.not;
|
|
|
@@ -104,7 +105,10 @@ public class CrossClusterQueryWithPartialResultsIT extends AbstractCrossClusterT
|
|
|
request.includeCCSMetadata(randomBoolean());
|
|
|
{
|
|
|
request.allowPartialResults(false);
|
|
|
- IllegalStateException error = expectThrows(IllegalStateException.class, () -> runQuery(request).close());
|
|
|
+ Exception error = expectThrows(Exception.class, () -> runQuery(request).close());
|
|
|
+ error = EsqlTestUtils.unwrapIfWrappedInRemoteException(error);
|
|
|
+
|
|
|
+ assertThat(error, instanceOf(IllegalStateException.class));
|
|
|
assertThat(error.getMessage(), containsString("Accessing failing field"));
|
|
|
}
|
|
|
request.allowPartialResults(true);
|
|
|
@@ -190,6 +194,7 @@ public class CrossClusterQueryWithPartialResultsIT extends AbstractCrossClusterT
|
|
|
{
|
|
|
request.allowPartialResults(false);
|
|
|
Exception error = expectThrows(Exception.class, () -> runQuery(request).close());
|
|
|
+ error = EsqlTestUtils.unwrapIfWrappedInRemoteException(error);
|
|
|
var unwrapped = ExceptionsHelper.unwrap(error, simulatedFailure.getClass());
|
|
|
assertNotNull(unwrapped);
|
|
|
assertThat(unwrapped.getMessage(), equalTo(simulatedFailure.getMessage()));
|
|
|
@@ -236,7 +241,8 @@ public class CrossClusterQueryWithPartialResultsIT extends AbstractCrossClusterT
|
|
|
request.includeCCSMetadata(randomBoolean());
|
|
|
{
|
|
|
request.allowPartialResults(false);
|
|
|
- var error = expectThrows(Exception.class, () -> runQuery(request).close());
|
|
|
+ Exception error = expectThrows(Exception.class, () -> runQuery(request).close());
|
|
|
+ error = EsqlTestUtils.unwrapIfWrappedInRemoteException(error);
|
|
|
EsqlTestUtils.assertEsqlFailure(error);
|
|
|
var unwrapped = ExceptionsHelper.unwrap(error, simulatedFailure.getClass());
|
|
|
assertNotNull(unwrapped);
|