diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoCli.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoCli.java index c77b270de0c3..cf0426bf3c09 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoCli.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoCli.java @@ -40,6 +40,7 @@ import static io.trino.tests.product.TestGroups.AUTHORIZATION; import static io.trino.tests.product.TestGroups.CLI; import static io.trino.tests.product.TestGroups.PROFILE_SPECIFIC_TESTS; +import static io.trino.tests.product.utils.QueryExecutors.onTrino; import static java.lang.String.format; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.Files.writeString; @@ -96,10 +97,10 @@ public TestTrinoCli() @AfterTestWithContext @Override - public void stopPresto() + public void stopCli() throws InterruptedException { - super.stopPresto(); + super.stopCli(); } @Override @@ -409,22 +410,25 @@ public void shouldPrintExplainAnalyzePlan() { launchTrinoCliWithServerArgument(); trino.waitForPrompt(); - trino.getProcessInput().println("EXPLAIN ANALYZE CREATE TABLE iceberg.default.test_table AS SELECT * FROM hive.default.nation LIMIT 10;"); + trino.getProcessInput().println("EXPLAIN ANALYZE CREATE TABLE iceberg.default.test_print_explain_analyze AS SELECT * FROM hive.default.nation LIMIT 10;"); List lines = trimLines(trino.readLinesUntilPrompt()); // TODO once https://github.com/trinodb/trino/issues/14253 is done this should be assertThat(lines).contains("CREATE TABLE: 1 row", "Query Plan"); assertThat(lines).contains("CREATE TABLE", "Query Plan"); // TODO once https://github.com/trinodb/trino/issues/14253 is done this should be assertThat(lines).contains("INSERT: 1 row", "Query Plan"); - trino.getProcessInput().println("EXPLAIN ANALYZE INSERT INTO iceberg.default.test_table VALUES(100, 'URUGUAY', 3, 'test comment');"); + trino.getProcessInput().println("EXPLAIN ANALYZE INSERT INTO iceberg.default.test_print_explain_analyze VALUES(100, 'URUGUAY', 3, 'test comment');"); lines = trimLines(trino.readLinesUntilPrompt()); assertThat(lines).contains("INSERT", "Query Plan"); // TODO once https://github.com/trinodb/trino/issues/14253 is done this should be assertThat(lines).contains("UPDATE: 1 row", "Query Plan"); - trino.getProcessInput().println("EXPLAIN ANALYZE UPDATE iceberg.default.test_table SET n_comment = 'testValue 5' WHERE n_nationkey = 100;"); + trino.getProcessInput().println("EXPLAIN ANALYZE UPDATE iceberg.default.test_print_explain_analyze SET n_comment = 'testValue 5' WHERE n_nationkey = 100;"); lines = trimLines(trino.readLinesUntilPrompt()); assertThat(lines).contains("UPDATE", "Query Plan"); // TODO once https://github.com/trinodb/trino/issues/14253 is done this should be assertThat(lines).contains("DELETE: 1 row", "Query Plan"); - trino.getProcessInput().println("EXPLAIN ANALYZE DELETE FROM iceberg.default.test_table WHERE n_nationkey = 100;"); + trino.getProcessInput().println("EXPLAIN ANALYZE DELETE FROM iceberg.default.test_print_explain_analyze WHERE n_nationkey = 100;"); lines = trimLines(trino.readLinesUntilPrompt()); assertThat(lines).contains("DELETE", "Query Plan"); + + // cleanup + onTrino().executeQuery("DROP TABLE iceberg.default.test_print_explain_analyze"); } private void launchTrinoCliWithServerArgument(String... arguments) diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoLdapCli.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoLdapCli.java index f3f96a97b1a6..795bb82d03ed 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoLdapCli.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TestTrinoLdapCli.java @@ -95,10 +95,10 @@ public TestTrinoLdapCli() @AfterTestWithContext @Override - public void stopPresto() + public void stopCli() throws InterruptedException { - super.stopPresto(); + super.stopCli(); } @Override diff --git a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TrinoCliLauncher.java b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TrinoCliLauncher.java index e8fbed670779..bfc68ec663ed 100644 --- a/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TrinoCliLauncher.java +++ b/testing/trino-product-tests/src/main/java/io/trino/tests/product/cli/TrinoCliLauncher.java @@ -53,7 +53,7 @@ protected TrinoCliLauncher() nationTableBatchLines = readLines(getResource("io/trino/tests/product/cli/batch_query.results"), UTF_8); } - protected void stopPresto() + protected void stopCli() throws InterruptedException { if (trino != null) {