1
0

[HOTFIX] close spark session in functional test suite and disable spark3 test for spark2 (#2727)

This commit is contained in:
Gary Li
2021-03-26 20:58:29 -07:00
committed by Gary Li
parent d415d45416
commit 452f5e2d66
5 changed files with 35 additions and 1 deletions

View File

@@ -152,6 +152,8 @@ public class FunctionalTestHarness implements SparkProvider, DFSProvider, Hoodie
hdfsTestService.stop(); hdfsTestService.stop();
hdfsTestService = null; hdfsTestService = null;
jsc.close();
jsc = null;
spark.stop(); spark.stop();
spark = null; spark = null;
})); }));
@@ -166,5 +168,19 @@ public class FunctionalTestHarness implements SparkProvider, DFSProvider, Hoodie
for (FileStatus f : fileStatuses) { for (FileStatus f : fileStatuses) {
fs.delete(f.getPath(), true); fs.delete(f.getPath(), true);
} }
if (hdfsTestService != null) {
hdfsTestService.stop();
hdfsTestService = null;
}
if (spark != null) {
spark.stop();
spark = null;
}
if (jsc != null) {
jsc.close();
jsc = null;
}
sqlContext = null;
context = null;
} }
} }

View File

@@ -151,7 +151,7 @@
<dependency> <dependency>
<groupId>org.scala-lang</groupId> <groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId> <artifactId>scala-library</artifactId>
<version>${scala11.version}</version> <version>${scala.version}</version>
</dependency> </dependency>
<!-- Hoodie --> <!-- Hoodie -->

View File

@@ -124,6 +124,13 @@
<skip>false</skip> <skip>false</skip>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>${skip.hudi-spark3.unit.tests}</skipTests>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.rat</groupId> <groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId> <artifactId>apache-rat-plugin</artifactId>

View File

@@ -124,15 +124,19 @@ public class UtilitiesTestBase {
public static void cleanupClass() { public static void cleanupClass() {
if (hdfsTestService != null) { if (hdfsTestService != null) {
hdfsTestService.stop(); hdfsTestService.stop();
hdfsTestService = null;
} }
if (hiveServer != null) { if (hiveServer != null) {
hiveServer.stop(); hiveServer.stop();
hiveServer = null;
} }
if (hiveTestService != null) { if (hiveTestService != null) {
hiveTestService.stop(); hiveTestService.stop();
hiveTestService = null;
} }
if (zookeeperTestService != null) { if (zookeeperTestService != null) {
zookeeperTestService.stop(); zookeeperTestService.stop();
zookeeperTestService = null;
} }
} }
@@ -150,6 +154,11 @@ public class UtilitiesTestBase {
TestDataSource.resetDataGen(); TestDataSource.resetDataGen();
if (jsc != null) { if (jsc != null) {
jsc.stop(); jsc.stop();
jsc = null;
}
if (sparkSession != null) {
sparkSession.close();
sparkSession = null;
} }
if (context != null) { if (context != null) {
context = null; context = null;

View File

@@ -133,6 +133,7 @@
<skipFTs>${skipTests}</skipFTs> <skipFTs>${skipTests}</skipFTs>
<skipITs>${skipTests}</skipITs> <skipITs>${skipTests}</skipITs>
<skip.hudi-spark2.unit.tests>${skipTests}</skip.hudi-spark2.unit.tests> <skip.hudi-spark2.unit.tests>${skipTests}</skip.hudi-spark2.unit.tests>
<skip.hudi-spark3.unit.tests>${skipTests}</skip.hudi-spark3.unit.tests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.basedir>${project.basedir}</main.basedir> <main.basedir>${project.basedir}</main.basedir>
<spark.bundle.hive.scope>provided</spark.bundle.hive.scope> <spark.bundle.hive.scope>provided</spark.bundle.hive.scope>
@@ -1424,6 +1425,7 @@
<properties> <properties>
<scala.version>${scala12.version}</scala.version> <scala.version>${scala12.version}</scala.version>
<scala.binary.version>2.12</scala.binary.version> <scala.binary.version>2.12</scala.binary.version>
<skip.hudi-spark3.unit.tests>true</skip.hudi-spark3.unit.tests>
</properties> </properties>
<activation> <activation>
<property> <property>