This is an automated email from the ASF dual-hosted git repository.

preetham02 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit f79c92353c72ab70732fc5c1608c7b847cd4ce2f
Author: Michael Blow <[email protected]>
AuthorDate: Sat Jul 5 14:23:40 2025 -0400

    [NO ISSUE][*DB][TEST] Minor test framework fixes
    
    Ext-ref: MB-65861
    Change-Id: I5cad75b8263f8461a73405531beeb056254ae47e
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20023
    Integration-Tests: Jenkins <[email protected]>
    Reviewed-by: Michael Blow <[email protected]>
    Tested-by: Michael Blow <[email protected]>
---
 .../test/java/org/apache/asterix/test/common/TestExecutor.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

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 f9d0efb1d2..8d943bf58a 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
@@ -2254,16 +2254,22 @@ public class TestExecutor {
                         }
                         fail(true, testCaseCtx, cUnit, testFileCtxs, pb, 
testFile, e);
                     } else {
-                        LOGGER.info("testFile {} raised an (expected) 
exception", testFile, e.toString());
+                        LOGGER.info("testFile {} raised an (expected) 
exception: {}", testFile, e.toString());
                     }
                 }
                 if (numOfFiles == testFileCtxs.size()) {
-                    if (testCaseCtx.numOfErrors < 
cUnit.getExpectedError().size()) {
+                    int numExpectedErrors = cUnit.getExpectedError().size();
+                    if (testCaseCtx.numOfErrors < numExpectedErrors) {
                         LOGGER.error("Test {} failed to raise (an) expected 
exception(s)", cUnit.getName());
                         throw new Exception(
                                 "Test \"" + cUnit.getName() + "\" FAILED; 
expected exception was not thrown...");
                     }
                     ensureWarnings(testCaseCtx.expectedWarnings, cUnit);
+                    if (testCaseCtx.numOfErrors > numExpectedErrors) {
+                        LOGGER.error("Test {} raised more exceptions than 
expected", cUnit.getName());
+                        throw new Exception(
+                                "Test \"" + cUnit.getName() + "\" FAILED; too 
many exceptions were thrown...");
+                    }
                     LOGGER.info(
                             "[TEST]: " + 
testCaseCtx.getTestCase().getFilePath() + "/" + cUnit.getName() + " PASSED ");
                     if (passedGroup != null) {

Reply via email to