This is an automated email from the ASF dual-hosted git repository. tkhurana pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/5.1 by this push: new b20c04d296 PHOENIX-6918 :- Addendum for PhoenixQueryTimeoutIT test failure (#1633) b20c04d296 is described below commit b20c04d296d8e0733036450f100e1b55d63d4b49 Author: Lokesh Khurana <khuranalokes...@gmail.com> AuthorDate: Wed Jun 28 09:35:03 2023 -0700 PHOENIX-6918 :- Addendum for PhoenixQueryTimeoutIT test failure (#1633) Co-authored-by: Lokesh Khurana <lokesh.khur...@salesforce.com> --- .../it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java b/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java index 46a62d9c53..b73da96d98 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/iterate/PhoenixQueryTimeoutIT.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.iterate; +import static org.apache.phoenix.exception.SQLExceptionCode.IO_EXCEPTION; import static org.apache.phoenix.exception.SQLExceptionCode.OPERATION_TIMED_OUT; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -33,7 +34,6 @@ import org.apache.phoenix.end2end.ParallelStatsDisabledTest; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.jdbc.PhoenixStatement; import org.apache.phoenix.query.QueryServices; -import org.apache.phoenix.util.EnvironmentEdgeManager; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -119,7 +119,11 @@ public class PhoenixQueryTimeoutIT extends ParallelStatsDisabledIT { fail("Expected query to timeout with a 1 ms timeout"); } catch (SQLException e) { //OPERATION_TIMED_OUT Exception expected - assertEquals(OPERATION_TIMED_OUT.getErrorCode(), e.getErrorCode()); + if (e.getErrorCode() == IO_EXCEPTION.getErrorCode() && e.getCause() instanceof SQLException) { + assertEquals(OPERATION_TIMED_OUT.getErrorCode(), ((SQLException) e.getCause()).getErrorCode()); + } else { + assertEquals(OPERATION_TIMED_OUT.getErrorCode(), e.getErrorCode()); + } } finally { BaseResultIterators.setForTestingSetTimeoutToMaxToLetQueryPassHere(false); }