You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ma...@apache.org on 2016/10/07 19:15:21 UTC
[06/48] phoenix git commit: PHOENIX-3308 Shutdown minicluster after
parallel tests complete
PHOENIX-3308 Shutdown minicluster after parallel tests complete
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/8174fc44
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/8174fc44
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/8174fc44
Branch: refs/heads/calcite
Commit: 8174fc44b73679fbb292316dac69e774703166f6
Parents: b4b7642
Author: James Taylor <ja...@apache.org>
Authored: Wed Sep 21 12:42:23 2016 -0700
Committer: James Taylor <ja...@apache.org>
Committed: Wed Sep 21 12:42:23 2016 -0700
----------------------------------------------------------------------
.../phoenix/end2end/ParallelRunListener.java | 30 ++++++++++
.../java/org/apache/phoenix/query/BaseTest.java | 17 +++---
pom.xml | 59 ++++++++++++++------
3 files changed, 81 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/8174fc44/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelRunListener.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelRunListener.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelRunListener.java
new file mode 100644
index 0000000..7da6ec5
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParallelRunListener.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.phoenix.query.BaseTest;
+import org.junit.runner.Result;
+import org.junit.runner.notification.RunListener;
+
+public class ParallelRunListener extends RunListener {
+ @Override
+ public void testRunFinished(Result result) throws Exception {
+ BaseTest.tearDownMiniCluster();
+ super.testRunFinished(result);
+ }
+}
http://git-wip-us.apache.org/repos/asf/phoenix/blob/8174fc44/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
index 74fa3fa..331f977 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/query/BaseTest.java
@@ -561,14 +561,17 @@ public abstract class BaseTest {
}
protected static void destroyDriver() throws Exception {
- if (driver != null) {
- try {
- assertTrue(destroyDriver(driver));
- } finally {
- driver = null;
+ try {
+ if (driver != null) {
+ try {
+ assertTrue(destroyDriver(driver));
+ } finally {
+ driver = null;
+ }
}
+ } finally {
+ teardownTxManager();
}
- teardownTxManager();
}
protected static void dropNonSystemTables() throws Exception {
@@ -579,7 +582,7 @@ public abstract class BaseTest {
}
}
- protected static void tearDownMiniCluster() throws Exception {
+ public static void tearDownMiniCluster() throws Exception {
try {
destroyDriver();
} finally {
http://git-wip-us.apache.org/repos/asf/phoenix/blob/8174fc44/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 825c0d7..f02eb7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,7 +118,7 @@
<!-- Plugin options -->
<numForkedUT>3</numForkedUT>
- <numForkedIT>7</numForkedIT>
+ <numForkedIT>5</numForkedIT>
<!-- Set default encoding so multi-byte tests work correctly on the Mac -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -241,6 +241,12 @@
<shutdown>kill</shutdown>
<testSourceDirectory>${basedir}/src/it/java</testSourceDirectory>
<groups>org.apache.phoenix.end2end.ParallelStatsEnabledTest</groups>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.apache.phoenix.end2end.ParallelRunListener</value>
+ </property>
+ </properties>
</configuration>
<goals>
<goal>integration-test</goal>
@@ -262,6 +268,12 @@
<shutdown>kill</shutdown>
<testSourceDirectory>${basedir}/src/it/java</testSourceDirectory>
<groups>org.apache.phoenix.end2end.ParallelStatsDisabledTest</groups>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.apache.phoenix.end2end.ParallelRunListener</value>
+ </property>
+ </properties>
</configuration>
<goals>
<goal>integration-test</goal>
@@ -269,22 +281,28 @@
</goals>
</execution>
<execution>
- <id>ClientManagedTimeTests</id>
- <configuration>
- <encoding>UTF-8</encoding>
- <forkCount>${numForkedIT}</forkCount>
- <runOrder>alphabetical</runOrder>
- <reuseForks>true</reuseForks>
- <argLine>-enableassertions -Xmx2000m -XX:MaxPermSize=128m -Djava.security.egd=file:/dev/./urandom "-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"</argLine>
- <redirectTestOutputToFile>${test.output.tofile}</redirectTestOutputToFile>
- <testSourceDirectory>${basedir}/src/it/java</testSourceDirectory>
- <groups>org.apache.phoenix.end2end.ClientManagedTimeTest</groups>
- <shutdown>kill</shutdown>
- </configuration>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
+ <id>ClientManagedTimeTests</id>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <forkCount>${numForkedIT}</forkCount>
+ <runOrder>alphabetical</runOrder>
+ <reuseForks>true</reuseForks>
+ <argLine>-enableassertions -Xmx2000m -XX:MaxPermSize=128m -Djava.security.egd=file:/dev/./urandom "-Djava.library.path=${hadoop.library.path}${path.separator}${java.library.path}"</argLine>
+ <redirectTestOutputToFile>${test.output.tofile}</redirectTestOutputToFile>
+ <testSourceDirectory>${basedir}/src/it/java</testSourceDirectory>
+ <groups>org.apache.phoenix.end2end.ClientManagedTimeTest</groups>
+ <shutdown>kill</shutdown>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.apache.phoenix.end2end.ParallelRunListener</value>
+ </property>
+ </properties>
+ </configuration>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
</execution>
<execution>
<id>HBaseManagedTimeTests</id>
@@ -298,6 +316,12 @@
<testSourceDirectory>${basedir}/src/it/java</testSourceDirectory>
<groups>org.apache.phoenix.end2end.HBaseManagedTimeTest</groups>
<shutdown>kill</shutdown>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.apache.phoenix.end2end.ParallelRunListener</value>
+ </property>
+ </properties>
</configuration>
<goals>
<goal>integration-test</goal>
@@ -418,7 +442,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
- <!--skip>true</skip-->
<forkCount>${numForkedUT}</forkCount>
<reuseForks>true</reuseForks>
<argLine>-enableassertions -Xmx2250m -XX:MaxPermSize=128m