Skip to content

Commit

Permalink
Added check for server version in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chernser committed Mar 18, 2024
1 parent fbb6ae7 commit ce2157b
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ce2157b

Please sign in to comment.