You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2020/05/28 22:56:11 UTC

[impala] 01/02: IMPALA-9743: ExprCardinalityTest should reset the test flag at the end of the test

This is an automated email from the ASF dual-hosted git repository.

tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 974fce33dc5d41579ac6aa25f0a803fbd165d634
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Wed May 27 07:55:09 2020 +0800

    IMPALA-9743: ExprCardinalityTest should reset the test flag at the end of the test
    
    In the previous patch, we set the test flag when running
    ExprCardinalityTest. We should reset this flag at the end of the test.
    Otherwise, some tests that require this flag unset (e.g. CatalogTest)
    will fail.
    
    Ideally, each FE test should take care of the test flag and set/unset it
    explicitly. We'll gone through all tests to fix this in IMPALA-9780.
    
    Tests:
     - Ran CORE tests
    
    Change-Id: Id8a1085d73666db5df038dc231f14c31206375ed
    Reviewed-on: http://gerrit.cloudera.org:8080/15987
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 .../test/java/org/apache/impala/analysis/ExprCardinalityTest.java   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fe/src/test/java/org/apache/impala/analysis/ExprCardinalityTest.java b/fe/src/test/java/org/apache/impala/analysis/ExprCardinalityTest.java
index 28b58da..0657e2d 100644
--- a/fe/src/test/java/org/apache/impala/analysis/ExprCardinalityTest.java
+++ b/fe/src/test/java/org/apache/impala/analysis/ExprCardinalityTest.java
@@ -35,6 +35,7 @@ import org.apache.impala.common.InternalException;
 import org.apache.impala.common.QueryFixture.SelectFixture;
 import org.apache.impala.common.RuntimeEnv;
 import org.apache.impala.planner.CardinalityTest;
+import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -84,6 +85,11 @@ public class ExprCardinalityTest {
     RuntimeEnv.INSTANCE.setTestEnv(true);
   }
 
+  @AfterClass
+  public static void cleanUp() {
+    RuntimeEnv.INSTANCE.reset();
+  }
+
   private void verifyTableCol(Table table, String colName,
       long expectedNdv, long expectedNullCount) {
     Column col = table.getColumn(colName);