From 347330bcf6a8382868bd9d0622b9906cf90f0965 Mon Sep 17 00:00:00 2001 From: 924060929 <924060929@qq.com> Date: Mon, 24 Jun 2024 17:00:15 +0800 Subject: [PATCH] fix unstable ut --- .../org/apache/doris/qe/HmsQueryCacheTest.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java b/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java index 0414b5d148949b6..86c460e6bfd6031 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java @@ -517,8 +517,13 @@ public void testNotHitSqlCache() throws Exception { init((HMSExternalCatalog) mgr.getCatalog(HMS_CATALOG)); StatementBase parseStmt = parseAndAnalyzeStmt("select * from hms_ctl.hms_db.hms_tbl", connectContext); List scanNodes = Arrays.asList(hiveScanNode1); + + CacheAnalyzer ca2 = new CacheAnalyzer(connectContext, parseStmt, scanNodes); + ca2.checkCacheMode(0); + long latestPartitionTime = ca2.getLatestTable().latestPartitionTime; + CacheAnalyzer ca = new CacheAnalyzer(connectContext, parseStmt, scanNodes); - ca.checkCacheMode(0); + ca.checkCacheMode(latestPartitionTime); Assert.assertEquals(CacheAnalyzer.CacheMode.None, ca.getCacheMode()); } @@ -527,8 +532,13 @@ public void testNotHitSqlCacheByNereids() { init((HMSExternalCatalog) mgr.getCatalog(HMS_CATALOG)); StatementBase parseStmt = analyzeAndGetStmtByNereids("select * from hms_ctl.hms_db.hms_tbl", connectContext); List scanNodes = Arrays.asList(hiveScanNode1); + + CacheAnalyzer ca2 = new CacheAnalyzer(connectContext, parseStmt, scanNodes); + ca2.checkCacheModeForNereids(0); + long latestPartitionTime = ca2.getLatestTable().latestPartitionTime; + CacheAnalyzer ca = new CacheAnalyzer(connectContext, parseStmt, scanNodes); - ca.checkCacheModeForNereids(0); + ca.checkCacheModeForNereids(latestPartitionTime); Assert.assertEquals(CacheAnalyzer.CacheMode.None, ca.getCacheMode()); }