Skip to content

Commit

Permalink
Fix flaky TestCassandraConnectorTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Apr 25, 2024
1 parent 7d2ce91 commit 476b95d
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ public void testCharVarcharComparison()
.hasMessage("Unsupported type: char(3)");
}

@Test
@Override // Override because some tests (e.g. testKeyspaceNameAmbiguity) cause table listing failure
public void testShowInformationSchemaTables()
{
executeExclusively(super::testShowInformationSchemaTables);
}

@Test
@Override // Override because some tests (e.g. testKeyspaceNameAmbiguity, testNativeQueryCaseSensitivity) cause column listing failure
public void testSelectInformationSchemaColumns()
Expand Down Expand Up @@ -958,6 +965,9 @@ public void testKeyspaceNameAmbiguity()

session.execute("DROP KEYSPACE \"KeYsPaCe_3\"");
session.execute("DROP KEYSPACE \"kEySpAcE_3\"");
// Wait until the schema becomes invisible to Trino. Otherwise, testSelectInformationSchemaColumns may fail due to ambiguous schema names.
assertEventually(() -> assertThat(computeActual("SHOW SCHEMAS FROM cassandra").getOnlyColumnAsSet())
.doesNotContain("keyspace_3"));
}

@Test
Expand Down Expand Up @@ -1479,6 +1489,8 @@ public void testNativeQueryCaseSensitivity()
"VALUES (1, 2)");

onCassandra("DROP TABLE tpch." + tableName);
// Wait until the table becomes invisible to Trino. Otherwise, testSelectInformationSchemaColumns may fail due to ambiguous column names.
assertEventually(() -> assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse());
}

@Test
Expand Down

0 comments on commit 476b95d

Please sign in to comment.