From b5e1e36750f6ea72bfd888eaa5c03ffcb76f72b3 Mon Sep 17 00:00:00 2001 From: zhangdong <493738387@qq.com> Date: Sat, 9 Sep 2023 00:49:40 +0800 Subject: [PATCH] [fix](pipeline)add logs for unstable cases #24073 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue Number: close #xxx ShowTableStmtTest.testNoDb and DropDbStmtTest.testNoPriv are unstable cases,error msg is: java.lang.Exception: Unexpected exception, expected but was we can not know what is missing ,and this issue cannot be reproduced locally,so add some log --- .../org/apache/doris/analysis/DropDbStmtTest.java | 14 ++++++++++---- .../apache/doris/analysis/ShowTableStmtTest.java | 13 ++++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/fe/fe-core/src/test/java/org/apache/doris/analysis/DropDbStmtTest.java b/fe/fe-core/src/test/java/org/apache/doris/analysis/DropDbStmtTest.java index f74b3d76b7..e52a478e79 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/analysis/DropDbStmtTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/analysis/DropDbStmtTest.java @@ -60,11 +60,17 @@ public class DropDbStmtTest { Assert.fail("no exception"); } - @Test(expected = AnalysisException.class) - public void testNoPriv() throws UserException, AnalysisException { + @Test + public void testNoPriv() { DropDbStmt stmt = new DropDbStmt(false, "", true); - - stmt.analyze(AccessTestUtil.fetchBlockAnalyzer()); + try { + stmt.analyze(AccessTestUtil.fetchBlockAnalyzer()); + } catch (AnalysisException e) { + return; + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } Assert.fail("no exception"); } } diff --git a/fe/fe-core/src/test/java/org/apache/doris/analysis/ShowTableStmtTest.java b/fe/fe-core/src/test/java/org/apache/doris/analysis/ShowTableStmtTest.java index b2b853c8a8..23948d4ab9 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/analysis/ShowTableStmtTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/analysis/ShowTableStmtTest.java @@ -68,10 +68,17 @@ public class ShowTableStmtTest { Assert.assertEquals("Table_type", stmt.getMetaData().getColumn(1).getName()); } - @Test(expected = AnalysisException.class) - public void testNoDb() throws AnalysisException { + @Test + public void testNoDb() { ShowTableStmt stmt = new ShowTableStmt("", null, false, null); - stmt.analyze(AccessTestUtil.fetchEmptyDbAnalyzer()); + try { + stmt.analyze(AccessTestUtil.fetchEmptyDbAnalyzer()); + } catch (AnalysisException e) { + return; + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(e.getMessage()); + } Assert.fail("No exception throws"); } }