[fix](pipeline)add logs for unstable cases #24073

Issue Number: close #xxx

ShowTableStmtTest.testNoDb and DropDbStmtTest.testNoPriv are unstable cases,error msg is:

java.lang.Exception: Unexpected exception, expected<org.apache.doris.common.AnalysisException> but was<mockit.internal.expectations.invocation.MissingInvocation>
we can not know what is missing ,and this issue cannot be reproduced locally,so add some log
This commit is contained in:
zhangdong
2023-09-09 00:49:40 +08:00
committed by GitHub
parent 7abd23cad1
commit b5e1e36750
2 changed files with 20 additions and 7 deletions

View File

@ -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");
}
}

View File

@ -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");
}
}