Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 9e5cb5d2e -> 9296254e2
PHOENIX-4159 phoenix-spark tests are failing Fix usage of underlying JUnit 'TemporaryFolder' in phoenix-spark tests. Need to disable parallel execution until JUnit 4.13 is released (https://github.com/junit-team/junit4/issues/1223) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9296254e Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9296254e Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9296254e Branch: refs/heads/4.x-HBase-1.1 Commit: 9296254e2f7b08be2a5314952fad9acf717bdcf9 Parents: 9e5cb5d Author: Josh Mahonin <jmaho...@gmail.com> Authored: Wed Sep 6 13:21:57 2017 -0400 Committer: Josh Mahonin <jmaho...@gmail.com> Committed: Wed Sep 6 13:24:42 2017 -0400 ---------------------------------------------------------------------- phoenix-spark/pom.xml | 5 ++++- .../phoenix/spark/AbstractPhoenixSparkIT.scala | 17 ++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/9296254e/phoenix-spark/pom.xml ---------------------------------------------------------------------- diff --git a/phoenix-spark/pom.xml b/phoenix-spark/pom.xml index 89c5ba5..7e804a8 100644 --- a/phoenix-spark/pom.xml +++ b/phoenix-spark/pom.xml @@ -549,7 +549,10 @@ <goal>test</goal> </goals> <configuration> - <parallel>true</parallel> + <!-- Need this false until we can switch to JUnit 4.13 due to + https://github.com/junit-team/junit4/issues/1223 + --> + <parallel>false</parallel> <tagsToExclude>Integration-Test</tagsToExclude> <argLine>-Xmx1536m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=512m</argLine> </configuration> http://git-wip-us.apache.org/repos/asf/phoenix/blob/9296254e/phoenix-spark/src/it/scala/org/apache/phoenix/spark/AbstractPhoenixSparkIT.scala ---------------------------------------------------------------------- diff --git a/phoenix-spark/src/it/scala/org/apache/phoenix/spark/AbstractPhoenixSparkIT.scala b/phoenix-spark/src/it/scala/org/apache/phoenix/spark/AbstractPhoenixSparkIT.scala index ecaedc7..ca3470f 100644 --- a/phoenix-spark/src/it/scala/org/apache/phoenix/spark/AbstractPhoenixSparkIT.scala +++ b/phoenix-spark/src/it/scala/org/apache/phoenix/spark/AbstractPhoenixSparkIT.scala @@ -20,7 +20,7 @@ import org.apache.phoenix.end2end.BaseHBaseManagedTimeIT import org.apache.phoenix.query.BaseTest import org.apache.phoenix.util.PhoenixRuntime import org.apache.spark.{SparkConf, SparkContext} -import org.scalatest.{BeforeAndAfterAll, FunSuite, Matchers} +import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, FunSuite, Matchers} // Helper object to access the protected abstract static methods hidden in BaseHBaseManagedTimeIT @@ -33,7 +33,10 @@ object PhoenixSparkITHelper extends BaseHBaseManagedTimeIT { BaseHBaseManagedTimeIT.doSetup() } - def doTeardown = BaseHBaseManagedTimeIT.doTeardown() + def doTeardown = { + BaseHBaseManagedTimeIT.doTeardown() + BaseTest.tmpFolder.delete() + } def getUrl = BaseTest.getUrl } @@ -41,7 +44,7 @@ object PhoenixSparkITHelper extends BaseHBaseManagedTimeIT { /** * Base class for PhoenixSparkIT */ -class AbstractPhoenixSparkIT extends FunSuite with Matchers with BeforeAndAfterAll { +class AbstractPhoenixSparkIT extends FunSuite with Matchers with BeforeAndAfter with BeforeAndAfterAll { // A global tenantId we can use across tests final val TenantId = "theTenant" @@ -62,9 +65,8 @@ class AbstractPhoenixSparkIT extends FunSuite with Matchers with BeforeAndAfterA // Optional argument tenantId used for running tenant-specific SQL def setupTables(sqlSource: String, tenantId: Option[String]): Unit = { val props = new Properties - val id = tenantId match { - case Some(tid) => props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tid) - case _ => + if(tenantId.isDefined) { + props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId.get) } conn = DriverManager.getConnection(PhoenixSparkITHelper.getUrl, props) @@ -88,7 +90,7 @@ class AbstractPhoenixSparkIT extends FunSuite with Matchers with BeforeAndAfterA PhoenixSparkITHelper.doSetup // We pass in null for TenantId here since these tables will be globally visible - setupTables("globalSetup.sql", null) + setupTables("globalSetup.sql", None) // We pass in a TenantId to allow the DDL to create tenant-specific tables/views setupTables("tenantSetup.sql", Some(TenantId)) @@ -103,6 +105,7 @@ class AbstractPhoenixSparkIT extends FunSuite with Matchers with BeforeAndAfterA override def afterAll() { conn.close() sc.stop() + PhoenixSparkITHelper.cleanUpAfterTest() PhoenixSparkITHelper.doTeardown } }