pan3793 commented on code in PR #8893:
URL: https://github.com/apache/hadoop/pull/8893#discussion_r4488416116


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java:
##########
@@ -1495,7 +1495,9 @@ void checkEvents(EventHandler<T> eventHandler,
         }
       }
     }
-    failures.ifExceptionThrow();
+    if (!failures.isEmpty()) {
+      throw new MultipleFailuresError("checkEvents", failures);

Review Comment:
   Please keep the `addSuppressed` line: the `MultipleFailuresError` 
constructor doesn't attach the failures, so their stack traces and causes are 
lost. `assertAll` does both, and trunk kept them too.
   
   ```suggestion
         MultipleFailuresError error = new MultipleFailuresError("checkEvents", 
failures);
         failures.forEach(error::addSuppressed);
         throw error;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to