You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by as...@apache.org on 2022/08/18 21:25:35 UTC
[impala] 01/02: IMPALA-11469: (Addendum) Initialize BackendConfig
This is an automated email from the ASF dual-hosted git repository.
asherman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit c1610a16377ae1254943cf321440060a41531d24
Author: Michael Smith <mi...@cloudera.com>
AuthorDate: Tue Aug 9 15:44:44 2022 -0700
IMPALA-11469: (Addendum) Initialize BackendConfig
Adds FrontendTestBase base class to FileMetadataLoaderTest to ensure
BackendConfig is set. Also switches FileSystemUtilTest to use
FrontendTestBase to be more consistent around initialization.
Failure to initialize BackendConfig meant that test success would depend
on their order. If FileSystemUtilTest or another test that initialized
it were the first to use FileSystemUtil, then everything would pass. If
not, the static declaration in FileSystemUtil would fail, causing the
class to fail to be loaded. Later tests would fail with NoClassDefFound
errors.
Testing:
- Ran frontend tests individually.
Change-Id: Iaefea5ac982e42a8b0f3b693d16a8db10cc7de31
Reviewed-on: http://gerrit.cloudera.org:8080/18840
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
.../org/apache/impala/catalog/FileMetadataLoaderTest.java | 3 ++-
.../java/org/apache/impala/common/FileSystemUtilTest.java | 12 ++----------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/fe/src/test/java/org/apache/impala/catalog/FileMetadataLoaderTest.java b/fe/src/test/java/org/apache/impala/catalog/FileMetadataLoaderTest.java
index 51070e201..a92595464 100644
--- a/fe/src/test/java/org/apache/impala/catalog/FileMetadataLoaderTest.java
+++ b/fe/src/test/java/org/apache/impala/catalog/FileMetadataLoaderTest.java
@@ -32,6 +32,7 @@ import org.apache.hadoop.hive.common.ValidWriteIdList;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.impala.catalog.HdfsPartition.FileDescriptor;
import org.apache.impala.compat.MetastoreShim;
+import org.apache.impala.common.FrontendTestBase;
import org.apache.impala.thrift.TNetworkAddress;
import org.apache.impala.util.ListMap;
import org.junit.Test;
@@ -39,7 +40,7 @@ import org.junit.Test;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
-public class FileMetadataLoaderTest {
+public class FileMetadataLoaderTest extends FrontendTestBase {
@Test
public void testRecursiveLoading() throws IOException, CatalogException {
diff --git a/fe/src/test/java/org/apache/impala/common/FileSystemUtilTest.java b/fe/src/test/java/org/apache/impala/common/FileSystemUtilTest.java
index dba2bf4c4..c7e339ebc 100644
--- a/fe/src/test/java/org/apache/impala/common/FileSystemUtilTest.java
+++ b/fe/src/test/java/org/apache/impala/common/FileSystemUtilTest.java
@@ -25,9 +25,9 @@ import static org.junit.Assert.assertEquals;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
+import org.apache.impala.common.FrontendTestBase;
import org.apache.impala.service.BackendConfig;
import org.apache.impala.thrift.TBackendGflags;
-import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
@@ -39,20 +39,12 @@ import java.util.List;
/**
* Tests for the various util methods in FileSystemUtil class
*/
-public class FileSystemUtilTest {
+public class FileSystemUtilTest extends FrontendTestBase {
private static final String HIVE_TEMP_FILE_PREFIX = "_tmp.";
private static final String SPARK_TEMP_FILE_PREFIX = "_spark_metadata";
private static final Path TEST_TABLE_PATH = new Path("/test-warehouse/foo"
+ ".db/filesystem-util-test");
- @Before
- public void setUp() {
- // Make sure BackendConfig is initialized.
- if (BackendConfig.INSTANCE == null) {
- BackendConfig.create(new TBackendGflags());
- }
- }
-
@Test
public void testIsInIgnoredDirectory() {
// test positive cases