Skip to content

Commit

Permalink
Fix testSelectInformationSchemaColumns assertion for concurrency
Browse files Browse the repository at this point in the history
The test assumed there is only one table with name like `%orders%`,
which can be easily violated by a concurrently running test.
  • Loading branch information
findepi committed Feb 9, 2022
1 parent 4d32cef commit 4df4c5e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1001,10 +1001,11 @@ public void testSelectInformationSchemaColumns()
assertQuery("SELECT table_name, column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' AND table_name = 'orders'", ordersTableWithColumns);
assertQuery("SELECT table_name, column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' AND table_name LIKE '%rders'", ordersTableWithColumns);
assertQuery("SELECT table_name, column_name FROM information_schema.columns WHERE table_schema LIKE '" + schemaPattern + "' AND table_name LIKE '_rder_'", ordersTableWithColumns);
assertQuery(
assertThat(query(
"SELECT table_name, column_name FROM information_schema.columns " +
"WHERE table_catalog = '" + catalog + "' AND table_schema = '" + schema + "' AND table_name LIKE '%orders%'",
ordersTableWithColumns);
"WHERE table_catalog = '" + catalog + "' AND table_schema = '" + schema + "' AND table_name LIKE '%orders%'"))
.skippingTypesCheck()
.containsAll(ordersTableWithColumns);

assertQuerySucceeds("SELECT * FROM information_schema.columns");
assertQuery("SELECT DISTINCT table_name, column_name FROM information_schema.columns WHERE table_name LIKE '_rders'", ordersTableWithColumns);
Expand Down

0 comments on commit 4df4c5e

Please sign in to comment.