1
0

[HUDI-4456] Clean up test resources (#6203)

This commit is contained in:
Shiyan Xu
2022-07-25 10:13:06 -05:00
committed by GitHub
parent 71c2c3102b
commit eee6a02f77
7 changed files with 8 additions and 8 deletions

View File

@@ -206,7 +206,7 @@ public class HoodieFlinkClientTestHarness extends HoodieCommonTestHarness implem
protected void cleanupDFS() throws java.io.IOException { protected void cleanupDFS() throws java.io.IOException {
if (hdfsTestService != null) { if (hdfsTestService != null) {
hdfsTestService.stop(); hdfsTestService.stop();
dfsCluster.shutdown(); dfsCluster.shutdown(true, true);
hdfsTestService = null; hdfsTestService = null;
dfsCluster = null; dfsCluster = null;
dfs = null; dfs = null;

View File

@@ -195,7 +195,7 @@ public abstract class HoodieJavaClientTestHarness extends HoodieCommonTestHarnes
protected void cleanupDFS() throws IOException { protected void cleanupDFS() throws IOException {
if (hdfsTestService != null) { if (hdfsTestService != null) {
hdfsTestService.stop(); hdfsTestService.stop();
dfsCluster.shutdown(); dfsCluster.shutdown(true, true);
hdfsTestService = null; hdfsTestService = null;
dfsCluster = null; dfsCluster = null;
dfs = null; dfs = null;

View File

@@ -433,7 +433,7 @@ public abstract class HoodieClientTestHarness extends HoodieCommonTestHarness im
protected void cleanupDFS() throws IOException { protected void cleanupDFS() throws IOException {
if (hdfsTestService != null) { if (hdfsTestService != null) {
hdfsTestService.stop(); hdfsTestService.stop();
dfsCluster.shutdown(); dfsCluster.shutdown(true, true);
hdfsTestService = null; hdfsTestService = null;
dfsCluster = null; dfsCluster = null;
dfs = null; dfs = null;

View File

@@ -104,7 +104,7 @@ public class HdfsTestService {
public void stop() { public void stop() {
LOG.info("HDFS Minicluster service being shut down."); LOG.info("HDFS Minicluster service being shut down.");
if (miniDfsCluster != null) { if (miniDfsCluster != null) {
miniDfsCluster.shutdown(); miniDfsCluster.shutdown(true, true);
} }
miniDfsCluster = null; miniDfsCluster = null;
hadoopConf = null; hadoopConf = null;

View File

@@ -50,10 +50,10 @@ public class MiniClusterUtil {
public static void shutdown() { public static void shutdown() {
if (dfsCluster != null) { if (dfsCluster != null) {
dfsCluster.shutdown(); dfsCluster.shutdown(true, true);
} }
if (zkServer != null) { if (zkServer != null) {
zkServer.shutdown(); zkServer.shutdown(true);
} }
} }
} }

View File

@@ -103,7 +103,7 @@ public class TestInputPathHandler {
public static void cleanUp() throws Exception { public static void cleanUp() throws Exception {
if (hdfsTestService != null) { if (hdfsTestService != null) {
hdfsTestService.stop(); hdfsTestService.stop();
dfsCluster.shutdown(); dfsCluster.shutdown(true, true);
dfsCluster = null; dfsCluster = null;
dfs = null; dfs = null;
hdfsTestService = null; hdfsTestService = null;

View File

@@ -184,7 +184,7 @@ public class HiveTestUtil {
hiveTestService.stop(); hiveTestService.stop();
} }
if (zkServer != null) { if (zkServer != null) {
zkServer.shutdown(); zkServer.shutdown(true);
} }
fileSystem.close(); fileSystem.close();
} }