Skip to content

Commit

Permalink
Run TestPhoenixConnectorTest in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Jun 13, 2024
1 parent e035599 commit efeb6b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

0 comments on commit efeb6b6

Please sign in to comment.