More ASTERIXDB-1475
Ensure external-data test jar is on classpath for integration runtime
tests. Also, isolate downstream tests from upstream failures by manually
forcing existing instance to shutdown / delete prior to creating the
server for recovery tests.
Change-Id: I87f8ac08d1c78d0539607efa43f82ec2aba16b1b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/933
Reviewed-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <michael.blow@couchbase.com>
diff --git a/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java b/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
index f24be40..1c3c3da 100644
--- a/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
+++ b/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AbstractExecutionIT.java
@@ -76,6 +76,17 @@
AsterixLifecycleIT.setUp();
+ File externalTestsJar = new File(StringUtils.join(
+ new String[] { "..", "asterix-external-data", "target" } , File.separator)).listFiles(
+ (dir, name) -> name.matches("asterix-external-data-.*-tests.jar"))[0];
+
+ FileUtils.copyFile(externalTestsJar, new File(
+ AsterixInstallerIntegrationUtil.getManagixHome() + "/clusters/local/working_dir/asterix/repo/",
+ externalTestsJar.getName()));
+
+ AsterixLifecycleIT.restartInstance();
+
+
FileUtils.copyDirectoryStructure(
new File(StringUtils.join(new String[] { "..", "asterix-app", "data" }, File.separator)),
new File(AsterixInstallerIntegrationUtil.getManagixHome() + "/clusters/local/working_dir/data"));
diff --git a/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AsterixLifecycleIT.java b/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AsterixLifecycleIT.java
index 302275d..117751f 100644
--- a/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AsterixLifecycleIT.java
+++ b/asterixdb/asterix-installer/src/test/java/org/apache/asterix/installer/test/AsterixLifecycleIT.java
@@ -76,6 +76,11 @@
return testArgs;
}
+ public static void restartInstance() throws Exception {
+ AsterixInstallerIntegrationUtil.transformIntoRequiredState(State.INACTIVE);
+ AsterixInstallerIntegrationUtil.transformIntoRequiredState(State.ACTIVE);
+ }
+
@Test
public void test_1_StopActiveInstance() throws Exception {
try {
diff --git a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/create_and_start.sh b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/create_and_start.sh
index 789914b..3af1095 100755
--- a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/create_and_start.sh
+++ b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/dml_recovery/create_and_start.sh
@@ -15,4 +15,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+$MANAGIX_HOME/bin/managix stop -n asterix 1>/dev/null 2>&1;
+$MANAGIX_HOME/bin/managix delete -n asterix 1>/dev/null 2>&1;
$MANAGIX_HOME/bin/managix create -n asterix -c $MANAGIX_HOME/clusters/local/local.xml;
diff --git a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/big_object_20M/create_and_start.sh b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/big_object_20M/create_and_start.sh
index 37bc7b0..d3c75b2 100755
--- a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/big_object_20M/create_and_start.sh
+++ b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/big_object_20M/create_and_start.sh
@@ -1,2 +1,4 @@
jps | awk '{if ($2 == "NCDriver" || $2 == "CCDriver") print $1;}' | xargs -n 1 kill -9;
+$MANAGIX_HOME/bin/managix stop -n asterix 1>/dev/null 2>&1;
+$MANAGIX_HOME/bin/managix delete -n asterix 1>/dev/null 2>&1;
$MANAGIX_HOME/bin/managix create -n asterix -c $MANAGIX_HOME/clusters/local/local.xml;
diff --git a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/dataset-with-meta-record/create_and_start.sh b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/dataset-with-meta-record/create_and_start.sh
index b3e6d26..2e41189 100755
--- a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/dataset-with-meta-record/create_and_start.sh
+++ b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/dataset-with-meta-record/create_and_start.sh
@@ -1,3 +1,5 @@
+$MANAGIX_HOME/bin/managix stop -n nc1 1>/dev/null 2>&1;
+$MANAGIX_HOME/bin/managix delete -n nc1 1>/dev/null 2>&1;
$MANAGIX_HOME/bin/managix create -n nc1 -c $MANAGIX_HOME/clusters/local/local.xml;
$MANAGIX_HOME/bin/managix stop -n nc1;
cp $MANAGIX_HOME/../../../asterix-external-data/target/asterix-external-data-*-tests.jar \
diff --git a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/external_index/create_and_start.sh b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/external_index/create_and_start.sh
index 945f01d..70770a0 100755
--- a/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/external_index/create_and_start.sh
+++ b/asterixdb/asterix-installer/src/test/resources/transactionts/scripts/query_after_restart/external_index/create_and_start.sh
@@ -1 +1,3 @@
+$MANAGIX_HOME/bin/managix stop -n nc1 1>/dev/null 2>&1;
+$MANAGIX_HOME/bin/managix delete -n nc1 1>/dev/null 2>&1;
$MANAGIX_HOME/bin/managix create -n nc1 -c $MANAGIX_HOME/clusters/local/local.xml;