Skip to content

Commit

Permalink
[misc] ensure skysql test reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
diego Dupin committed Jan 21, 2022
1 parent 8467bb0 commit 80665f6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- if: type = push AND fork = false
env: srv=mysql v=5.7
- if: type = push AND fork = false
env: srv=mysql v=8.0
env: srv=mysql v=8.0 TEST_DB_OTHER=allowPublicKeyRetrieval
- if: type = push AND fork = false
env: srv=skysql
- if: type = push AND fork = false
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/org/mariadb/jdbc/ConnectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,9 @@ public void connectionUnexpectedClose() throws SQLException {
@Test
public void ensureSocketTimeoutState() throws Throwable {
Assume.assumeTrue(
!"maxscale".equals(System.getenv("srv")) && !"skysql-ha".equals(System.getenv("srv")));
!"maxscale".equals(System.getenv("srv"))
&& !"skysql-ha".equals(System.getenv("srv"))
&& !"skysql".equals(System.getenv("srv")));

Statement stmt = sharedConnection.createStatement();
stmt.execute("DROP TABLE IF EXISTS ensureSocketTimeoutState");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ private void assertType(
String columnName =
columnType.replace(" ", "_").replace("(", "_").replace(")", "").replace(",", "_");
try (Statement stmt = sharedConnection.createStatement()) {
stmt.execute("DROP TABLE IF EXISTS my_table_" + columnName);
stmt.execute("CREATE TABLE my_table_" + columnName + "(my_col " + columnType + ")");
stmt.execute("FLUSH TABLES");
stmt.execute("INSERT INTO my_table_" + columnName + "(my_col) VALUES (" + strValue + ")");
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/org/mariadb/jdbc/DriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,8 @@ public void testRollbackOnClose() throws SQLException {

@Test
public void testAutoCommit() throws SQLException {
Assume.assumeTrue(
!"maxscale".equals(System.getenv("srv")) && !"skysql-ha".equals(System.getenv("srv")));
try (Connection connection = setConnection()) {
assertTrue(connection.getAutoCommit());
Statement stmt = connection.createStatement();
Expand Down

0 comments on commit 80665f6

Please sign in to comment.