Skip to content

Commit 722cdab

Browse files
github-actions[bot]FANNG1yuqi1129
authored
[#6392] fix(test): SparkJdbcMysqlCatalogIT33 failed in some enviroment (#6568)
### What changes were proposed in this pull request? I'm not sure the root reason, seems MYSQL JDBC driver was not loaded automatically in some condition, in this PR, load Mysql driver explicitly. ### Why are the changes needed? Fix: #6392 ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? test in local machine. Co-authored-by: FANNG <xiaojing@datastrato.com> Co-authored-by: Qi Yu <yuqi@datastrato.com>
1 parent 681845f commit 722cdab

File tree

1 file changed

+8
-0
lines changed
  • integration-test-common/src/test/java/org/apache/gravitino/integration/test/container

1 file changed

+8
-0
lines changed

integration-test-common/src/test/java/org/apache/gravitino/integration/test/container/MySQLContainer.java

+8
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ public void createDatabase(TestDatabaseName testDatabaseName) {
119119
StringUtils.substring(
120120
getJdbcUrl(testDatabaseName), 0, getJdbcUrl(testDatabaseName).lastIndexOf("/"));
121121

122+
// Fix https://github.com/apache/gravitino/issues/6392, MYSQL JDBC driver may not load
123+
// automatically.
124+
try {
125+
Class.forName("com.mysql.jdbc.Driver");
126+
} catch (Exception e) {
127+
throw new RuntimeException("Failed to load MySQL JDBC driver", e);
128+
}
129+
122130
// change password for root user, Gravitino API must set password in catalog properties
123131
try (Connection connection =
124132
DriverManager.getConnection(mySQLJdbcUrl, USER_NAME, getPassword());

0 commit comments

Comments
 (0)