Skip to content

Commit 470a550

Browse files
authored
SQL: Improve testCatalogDependentCommands() reliability (#79555) (#79562)
`SHOW TABLES` by itself will list all tables available in the cluster. If async events produce any ".some_system_index" test, the newly available index will interfere with test's assumptions. Fixes #79548. (cherry picked from commit 0b1e118)
1 parent 54c446d commit 470a550

File tree

1 file changed

+5
-1
lines changed
  • x-pack/plugin/sql/qa/server/multi-cluster-with-security/src/test/java/org/elasticsearch/xpack/sql/qa/multi_cluster_with_security

1 file changed

+5
-1
lines changed

x-pack/plugin/sql/qa/server/multi-cluster-with-security/src/test/java/org/elasticsearch/xpack/sql/qa/multi_cluster_with_security/JdbcCatalogIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ public void testQueryCatalogPrecedence() throws Exception {
7171
}
7272

7373
public void testCatalogDependentCommands() throws Exception {
74-
for (String query : Arrays.asList("SHOW TABLES", "SHOW COLUMNS FROM \"" + INDEX_NAME + "\"", "DESCRIBE \"" + INDEX_NAME + "\"")) {
74+
for (String query : Arrays.asList(
75+
"SHOW TABLES \"" + INDEX_NAME + "\"",
76+
"SHOW COLUMNS FROM \"" + INDEX_NAME + "\"",
77+
"DESCRIBE \"" + INDEX_NAME + "\""
78+
)) {
7579
try (Connection es = esJdbc()) {
7680
PreparedStatement ps = es.prepareStatement(query);
7781
ResultSet rs = ps.executeQuery();

0 commit comments

Comments
 (0)