uros-b commented on code in PR #56769:
URL: https://github.com/apache/spark/pull/56769#discussion_r3473378313


##########
.github/workflows/test_report.yml:
##########
@@ -41,7 +41,17 @@ jobs:
         github-token: ${{ secrets.GITHUB_TOKEN }}
         run-id: ${{ github.event.workflow_run.id }}
         pattern: "test-*"
+    - name: Check if test results exist
+      id: check
+      run: |
+        if find . -path '*/target/test-reports/*.xml' | grep -q .; then

Review Comment:
   Please check - GitHub Actions runs run: steps with bash --noprofile --norc 
-eo pipefail {0} by default. When there are many matching files, grep -q exits 
at the first match and closes the pipe, so find is killed by SIGPIPE (exit 
141). Under pipefail, the pipeline's status becomes the rightmost non-zero exit 
(141), so the if evaluates to false — and the report is skipped even though 
results exist. So the normal success case (a real PR with thousands of test 
results) would have has_results=false and silently skip the test report — the 
opposite of the intended behavior, and arguably worse than the bug being fixed 
because it's silent.
   
   Suggested fix - Have find stop after the first match so it never receives 
SIGPIPE:
   ```
   if find . -path '*/target/test-reports/*.xml' -print -quit | grep -q .; then
   ...
   ```
   -quit exits find cleanly (status 0) after the first printed match, which 
also avoids scanning the whole tree.



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