Copilot commented on code in PR #3651:
URL: https://github.com/apache/maven-surefire/pull/3651#discussion_r4729326681


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java:
##########
@@ -238,30 +263,37 @@ public void testSetCompleted(TestSetReportEntry report) {
     @Override
     public void testStarting(ReportEntry report) {
         getTestSetStats(report).testStart();
+        Long testRunId = report.getTestRunId();
+        if (testRunId != null) {
+            synchronized (lock) {
+                // the test also gets what was printed since the previous 
test, like the output of @BeforeAll
+                runningTestsOutput.computeIfAbsent(testRunId, id -> 
takeSharedOutput());

Review Comment:
   If `ATest` prints in `@BeforeAll` and `BTest` starts its method first, this 
call transfers A's shared stdout/stderr into B's XML report. Route class-tagged 
output to per-class buffers, transfer only the starting test's class output, 
and retain remaining lifecycle output for the matching class report. Add a 
parallel lifecycle-output regression case.



-- 
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]

Reply via email to