You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uniffle.apache.org by ck...@apache.org on 2023/02/23 07:16:44 UTC
[incubator-uniffle] branch master updated: [#649] test: remove mini-cluster in ClientConfManagerTest (#650)
This is an automated email from the ASF dual-hosted git repository.
ckj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new dd50282e [#649] test: remove mini-cluster in ClientConfManagerTest (#650)
dd50282e is described below
commit dd50282ecc8b1ae762cd3a0b0600650585e1c702
Author: jokercurry <84...@users.noreply.github.com>
AuthorDate: Thu Feb 23 15:16:39 2023 +0800
[#649] test: remove mini-cluster in ClientConfManagerTest (#650)
### What changes were proposed in this pull request?
Mini-cluster need take some time to initialize, after the current path detection is triggered manually, we do not need to manually write the file to mini-cluster. So we can remove the dependency of this mini-cluster in Coordinator.
### Why are the changes needed?
Fix: #649
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Before:
```
[INFO] Running org.apache.uniffle.coordinator.ClientConfManagerTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 37.28 s - in org.apache.uniffle.coordinator.ClientConfManagerTest
```
After:
```
[INFO] Running org.apache.uniffle.coordinator.ClientConfManagerTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 33.071 s - in org.apache.uniffle.coordinator.ClientConfManagerTest
```
---
coordinator/pom.xml | 4 ----
.../uniffle/coordinator/ClientConfManagerTest.java | 21 ---------------------
2 files changed, 25 deletions(-)
diff --git a/coordinator/pom.xml b/coordinator/pom.xml
index d50f3cbe..0f2589c7 100644
--- a/coordinator/pom.xml
+++ b/coordinator/pom.xml
@@ -73,10 +73,6 @@
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-minicluster</artifactId>
- </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
diff --git a/coordinator/src/test/java/org/apache/uniffle/coordinator/ClientConfManagerTest.java b/coordinator/src/test/java/org/apache/uniffle/coordinator/ClientConfManagerTest.java
index 2622c0ed..5de30231 100644
--- a/coordinator/src/test/java/org/apache/uniffle/coordinator/ClientConfManagerTest.java
+++ b/coordinator/src/test/java/org/apache/uniffle/coordinator/ClientConfManagerTest.java
@@ -19,7 +19,6 @@ package org.apache.uniffle.coordinator;
import java.io.File;
import java.io.FileWriter;
-import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.util.Map;
@@ -29,8 +28,6 @@ import java.util.Set;
import com.google.common.collect.Sets;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -49,11 +46,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class ClientConfManagerTest {
- @TempDir
- private final File remotePath = new File("hdfs://rss");
- private static MiniDFSCluster cluster;
- private final Configuration hdfsConf = new Configuration();
-
@BeforeEach
public void setUp() {
CoordinatorMetrics.register();
@@ -64,18 +56,6 @@ public class ClientConfManagerTest {
CoordinatorMetrics.clear();
}
- @AfterAll
- public static void close() {
- cluster.close();
- }
-
- public void createMiniHdfs(String hdfsPath) throws IOException {
- hdfsConf.set("fs.defaultFS", remotePath.getAbsolutePath());
- hdfsConf.set("dfs.nameservices", "rss");
- hdfsConf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, hdfsPath);
- cluster = (new MiniDFSCluster.Builder(hdfsConf)).build();
- }
-
@Test
public void test(@TempDir File tempDir) throws Exception {
File cfgFile = File.createTempFile("tmp", ".conf", tempDir);
@@ -230,7 +210,6 @@ public class ClientConfManagerTest {
File cfgFile = Files.createTempFile("dynamicRemoteStorageTest", ".conf").toFile();
cfgFile.deleteOnExit();
writeRemoteStorageConf(cfgFile, remotePath1);
- createMiniHdfs(remotePath.getAbsolutePath());
CoordinatorConf conf = new CoordinatorConf();
conf.set(CoordinatorConf.COORDINATOR_DYNAMIC_CLIENT_CONF_UPDATE_INTERVAL_SEC, updateIntervalSec);