From 4df4c5edf6b9ff0c5c942d5b2d847848c83cd7b6 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 9 Feb 2022 10:41:35 +0100 Subject: [PATCH] Fix testSelectInformationSchemaColumns assertion for concurrency The test assumed there is only one table with name like `%orders%`, which can be easily violated by a concurrently running test. --- .../src/main/java/io/trino/testing/BaseConnectorTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java b/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java index 1154bf716ff4..6d8df5c3282a 100644 --- a/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java +++ b/testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java @@ -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);