Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run TestPhoenixConnectorTest in parallel #22372

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import io.trino.testing.DistributedQueryRunner;
import io.trino.testing.QueryRunner;
import io.trino.tpch.TpchTable;
import org.apache.hadoop.hbase.NamespaceExistException;
import org.apache.phoenix.exception.PhoenixIOException;
import org.intellij.lang.annotations.Language;

import java.sql.Connection;
Expand Down Expand Up @@ -121,6 +123,14 @@ private static void createSchema(TestingPhoenixServer phoenixServer, String sche
Statement statement = connection.createStatement()) {
statement.execute(format("CREATE SCHEMA IF NOT EXISTS %s", schema));
}
catch (PhoenixIOException e) {
if (e.getCause() instanceof NamespaceExistException) {
// Phoenix may throw this exception even if we specify IF NOT EXISTS option
LOG.debug("Namespace %s already exists", schema);
return;
}
throw e;
}
}

private static void copyTpchTables(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.trino.testing.sql.TestTable;
import org.intellij.lang.annotations.Language;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;

import java.sql.Connection;
import java.sql.DriverManager;
Expand Down Expand Up @@ -65,7 +64,6 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assumptions.abort;

@Isolated
public class TestPhoenixConnectorTest
extends BaseJdbcConnectorTest
{
Expand Down