Michael Blow has submitted this change and it was merged. Change subject: [NO ISSUE][TEST] Minimize output on poll comparison failures ......................................................................
[NO ISSUE][TEST] Minimize output on poll comparison failures Change-Id: I020a4199520c2246f8c5a54d8916bb12206c2013 Reviewed-on: https://asterix-gerrit.ics.uci.edu/2002 Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Contrib: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> --- M asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java 1 file changed, 14 insertions(+), 3 deletions(-) Approvals: Jenkins: Verified; No violations found; ; Verified Murtadha Hubail: Looks good to me, approved Objections: Anon. E. Moose #1000171: diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java index 06fbe63..b9b7bda 100644 --- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java +++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestExecutor.java @@ -46,6 +46,7 @@ import java.util.ListIterator; import java.util.Map; import java.util.Set; +import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -66,9 +67,9 @@ import org.apache.asterix.testframework.context.TestCaseContext.OutputFormat; import org.apache.asterix.testframework.context.TestFileContext; import org.apache.asterix.testframework.xml.ComparisonEnum; +import org.apache.asterix.testframework.xml.TestGroup; import org.apache.asterix.testframework.xml.TestCase.CompilationUnit; import org.apache.asterix.testframework.xml.TestCase.CompilationUnit.Parameter; -import org.apache.asterix.testframework.xml.TestGroup; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.output.ByteArrayOutputStream; @@ -1262,8 +1263,18 @@ throw new Exception("Poll limit (" + timeoutSecs + "s) exceeded without obtaining expected result"); } - } catch (Exception e) { - LOGGER.log(Level.INFO, "received exception on poll", e); + } catch (ExecutionException ee) { + Exception e; + if (ee.getCause() instanceof Exception) { + e = (Exception) ee.getCause(); + } else { + e = ee; + } + if (e instanceof ComparisonException) { + LOGGER.log(Level.INFO, "Comparison failure on poll: " + e.getMessage()); + } else { + LOGGER.log(Level.INFO, "received exception on poll", e); + } responsesReceived++; if (isExpected(e, cUnit)) { expectedException = true; -- To view, visit https://asterix-gerrit.ics.uci.edu/2002 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I020a4199520c2246f8c5a54d8916bb12206c2013 Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Michael Blow <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]>
