Skip to content

Commit

Permalink
Upgrade to testing-mysql-server 8.0.12-4
Browse files Browse the repository at this point in the history
Increase command timeouts from 30s to 90s.
  • Loading branch information
caithagoras0 committed May 29, 2019
1 parent 99d668a commit e0bd22d
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@
<dependency>
<groupId>io.airlift</groupId>
<artifactId>testing-mysql-server</artifactId>
<version>8.0.12-2</version>
<version>8.0.12-4</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,38 @@

import com.facebook.presto.testing.MaterializedResult;
import com.facebook.presto.tests.AbstractTestDistributedQueries;
import com.google.common.collect.ImmutableList;
import io.airlift.testing.mysql.MySqlOptions;
import io.airlift.testing.mysql.TestingMySqlServer;
import io.airlift.tpch.TpchTable;
import io.airlift.units.Duration;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

import static com.facebook.presto.plugin.mysql.MySqlQueryRunner.createMySqlQueryRunner;
import static com.facebook.presto.spi.type.VarcharType.VARCHAR;
import static com.facebook.presto.testing.MaterializedResult.resultBuilder;
import static com.facebook.presto.testing.assertions.Assert.assertEquals;
import static java.util.concurrent.TimeUnit.SECONDS;

@Test
public class TestMySqlDistributedQueries
extends AbstractTestDistributedQueries
{
private static final MySqlOptions MY_SQL_OPTIONS;

static {
MySqlOptions.Builder mySqlOptionsBuilder = MySqlOptions.builder();
mySqlOptionsBuilder.setCommandTimeout(new Duration(90, SECONDS));
MY_SQL_OPTIONS = mySqlOptionsBuilder.build();
}

private final TestingMySqlServer mysqlServer;

public TestMySqlDistributedQueries()
throws Exception
{
this(new TestingMySqlServer("testuser", "testpass", "tpch"));
this(new TestingMySqlServer("testuser", "testpass", ImmutableList.of("tpch"), MY_SQL_OPTIONS));
}

public TestMySqlDistributedQueries(TestingMySqlServer mysqlServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.AbstractTestIntegrationSmokeTest;
import com.facebook.presto.tests.DistributedQueryRunner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.airlift.testing.mysql.MySqlOptions;
import io.airlift.testing.mysql.TestingMySqlServer;
import io.airlift.units.Duration;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

Expand All @@ -36,19 +39,28 @@
import static com.facebook.presto.testing.assertions.Assert.assertEquals;
import static com.google.common.collect.Iterables.getOnlyElement;
import static io.airlift.tpch.TpchTable.ORDERS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;

@Test
public class TestMySqlIntegrationSmokeTest
extends AbstractTestIntegrationSmokeTest
{
private static final MySqlOptions MY_SQL_OPTIONS;

static {
MySqlOptions.Builder mySqlOptionsBuilder = MySqlOptions.builder();
mySqlOptionsBuilder.setCommandTimeout(new Duration(90, SECONDS));
MY_SQL_OPTIONS = mySqlOptionsBuilder.build();
}

private final TestingMySqlServer mysqlServer;

public TestMySqlIntegrationSmokeTest()
throws Exception
{
this(new TestingMySqlServer("testuser", "testpass", "tpch", "test_database"));
this(new TestingMySqlServer("testuser", "testpass", ImmutableList.of("tpch", "test_database"), MY_SQL_OPTIONS));
}

public TestMySqlIntegrationSmokeTest(TestingMySqlServer mysqlServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
import com.facebook.presto.tests.sql.JdbcSqlExecutor;
import com.facebook.presto.tests.sql.PrestoSqlExecutor;
import com.google.common.collect.ImmutableList;
import io.airlift.testing.mysql.MySqlOptions;
import io.airlift.testing.mysql.TestingMySqlServer;
import io.airlift.units.Duration;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -52,19 +54,27 @@
import static com.google.common.base.Verify.verify;
import static java.lang.String.format;
import static java.util.Collections.emptyList;
import static java.util.concurrent.TimeUnit.SECONDS;

@Test
public class TestMySqlTypeMapping
extends AbstractTestQueryFramework
{
private static final String CHARACTER_SET_UTF8 = "CHARACTER SET utf8";
private static final MySqlOptions MY_SQL_OPTIONS;

static {
MySqlOptions.Builder mySqlOptionsBuilder = MySqlOptions.builder();
mySqlOptionsBuilder.setCommandTimeout(new Duration(90, SECONDS));
MY_SQL_OPTIONS = mySqlOptionsBuilder.build();
}

private final TestingMySqlServer mysqlServer;

public TestMySqlTypeMapping()
throws Exception
{
this(new TestingMySqlServer("testuser", "testpass", "tpch"));
this(new TestingMySqlServer("testuser", "testpass", ImmutableList.of("tpch"), MY_SQL_OPTIONS));
}

private TestMySqlTypeMapping(TestingMySqlServer mysqlServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
import com.facebook.presto.raptor.RaptorPlugin;
import com.facebook.presto.tests.DistributedQueryRunner;
import com.facebook.presto.tpch.TpchPlugin;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.airlift.testing.mysql.MySqlOptions;
import io.airlift.testing.mysql.TestingMySqlServer;
import io.airlift.units.Duration;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

Expand All @@ -26,17 +29,26 @@

import static com.facebook.presto.raptor.RaptorQueryRunner.copyTables;
import static com.facebook.presto.raptor.RaptorQueryRunner.createSession;
import static java.util.concurrent.TimeUnit.SECONDS;

@Test
public class TestRaptorIntegrationSmokeTestMySql
extends TestRaptorIntegrationSmokeTest
{
private static final MySqlOptions MY_SQL_OPTIONS;

static {
MySqlOptions.Builder mySqlOptionsBuilder = MySqlOptions.builder();
mySqlOptionsBuilder.setCommandTimeout(new Duration(90, SECONDS));
MY_SQL_OPTIONS = mySqlOptionsBuilder.build();
}

private final TestingMySqlServer mysqlServer;

public TestRaptorIntegrationSmokeTestMySql()
throws Exception
{
this(new TestingMySqlServer("testuser", "testpass", "testdb"));
this(new TestingMySqlServer("testuser", "testpass", ImmutableList.of("testdb"), MY_SQL_OPTIONS));
}

private TestRaptorIntegrationSmokeTestMySql(TestingMySqlServer mysqlServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
import com.facebook.presto.Session;
import com.facebook.presto.plugin.memory.MemoryPlugin;
import com.facebook.presto.tests.StandaloneQueryRunner;
import com.google.common.collect.ImmutableList;
import io.airlift.testing.mysql.MySqlOptions;
import io.airlift.testing.mysql.TestingMySqlServer;
import io.airlift.units.Duration;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.Jdbi;
import org.jdbi.v3.sqlobject.SqlObjectPlugin;

import static com.facebook.presto.testing.TestingSession.testSessionBuilder;
import static java.util.concurrent.TimeUnit.SECONDS;

public class VerifierTestUtil
{
Expand All @@ -30,6 +34,14 @@ public class VerifierTestUtil
public static final String XDB = "presto";
public static final String VERIFIER_QUERIES_TABLE = "verifier_queries";

private static final MySqlOptions MY_SQL_OPTIONS;

static {
MySqlOptions.Builder mySqlOptionsBuilder = MySqlOptions.builder();
mySqlOptionsBuilder.setCommandTimeout(new Duration(90, SECONDS));
MY_SQL_OPTIONS = mySqlOptionsBuilder.build();
}

private VerifierTestUtil()
{
}
Expand All @@ -55,7 +67,7 @@ public static String getJdbcUrl(StandaloneQueryRunner queryRunner)
public static TestingMySqlServer setupMySql()
throws Exception
{
TestingMySqlServer mySqlServer = new TestingMySqlServer("testuser", "testpass", XDB);
TestingMySqlServer mySqlServer = new TestingMySqlServer("testuser", "testpass", ImmutableList.of(XDB), MY_SQL_OPTIONS);
try (Handle handle = getHandle(mySqlServer)) {
handle.execute("CREATE TABLE verifier_queries (\n" +
" id int(11) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,\n" +
Expand Down

0 comments on commit e0bd22d

Please sign in to comment.