Merge branch 'master' into yingyi/asterix_fix
diff --git a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
index a42a56b..f1fa2a3 100644
--- a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
+++ b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
@@ -338,7 +338,7 @@
StringWriter writerIn = new StringWriter();
IOUtils.copy(bisIn, writerIn, "UTF-8");
s.append(writerIn.toString());
-
+
BufferedInputStream bisErr = new BufferedInputStream(p.getErrorStream());
StringWriter writerErr = new StringWriter();
IOUtils.copy(bisErr, writerErr, "UTF-8");
@@ -422,7 +422,27 @@
break;
case "txnqar": //qar represents query after recovery
try {
- InputStream resultStream = executeQuery(statement);
+ ////////////// <begin of temporary fix> ////////////////////////////
+ //TODO
+ //Temporary fix in order not to block the build test(mvn verify)
+ //A proper fix should not have the while loop here.
+ int maxRetryCount = 12;
+ int tryCount = 0;
+ InputStream resultStream = null;
+ long sleepTime = 5;
+
+ do {
+ //wait until NC starts
+ sleepTime *= 2;
+ Thread.sleep(sleepTime);
+ if (++tryCount > maxRetryCount) {
+ LOGGER.info("Metadata node is not running - this test will fail.");
+ break;
+ }
+ resultStream = executeQuery(statement);
+ } while (resultStream.toString().contains("Connection refused to host"));
+ ////////////// <end of temporary fix> //////////////////////////////
+
qarFile = new File(actualPath + File.separator
+ testCaseCtx.getTestCase().getFilePath().replace(File.separator, "_") + "_"
+ cUnit.getName() + "_qar.adm");
@@ -449,7 +469,7 @@
pb,
getScriptPath(testFile.getAbsolutePath(), pb.environment().get("SCRIPT_HOME"),
statement.trim()));
- if(output.contains("ERROR")) {
+ if (output.contains("ERROR")) {
throw new Exception(output);
}
} catch (Exception e) {