From ce2157bc3753fcbd671814ad5d89339d9e2b67ac Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 18 Mar 2024 12:14:55 -0700 Subject: [PATCH] Added check for server version in tests --- .../clickhouse/client/ClientIntegrationTest.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/clickhouse-client/src/test/java/com/clickhouse/client/ClientIntegrationTest.java b/clickhouse-client/src/test/java/com/clickhouse/client/ClientIntegrationTest.java index 26d56c985..85cdf8ded 100644 --- a/clickhouse-client/src/test/java/com/clickhouse/client/ClientIntegrationTest.java +++ b/clickhouse-client/src/test/java/com/clickhouse/client/ClientIntegrationTest.java @@ -733,13 +733,16 @@ public void testPrimitiveArrayWithLowCardinality(String baseType, Object expecte ClickHouseColumn.of("", baseType)).newArrayValue(server.config).update(expectedValues) .toSqlExpression())); } catch (ClickHouseException e) { - if (e.getErrorCode() == ClickHouseException.ERROR_SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY) { - // expected to fail after 24.2 - // TODO: set as default behaviour after few releases - return; - } else { - Assert.fail("Exception code is " + e.getErrorCode(), e); + try (ClickHouseClient client = getClient()) { + if (e.getErrorCode() == ClickHouseException.ERROR_SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY && + checkServerVersion(client, server, "[24.2,)")) { + return; + } + } catch ( Exception e1) { + Assert.fail("Failed to check server version", e1); } + + Assert.fail("Exception code is " + e.getErrorCode(), e); } checkPrimitiveArrayValues(server, tableName, tableColumns, baseType, expectedValues); }