chenBright commented on code in PR #3599:
URL: https://github.com/apache/brpc/pull/3599#discussion_r4267086399


##########
test/run_tests.sh:
##########
@@ -39,28 +43,46 @@ for test_bin in $test_bins; do
         failed_test="$test_bin"
         break;
     fi
-done
+done 3<&0
 if [ $test_num -eq 0 ]; then
     >&2 echo "[runtest] Cannot find any tests"
     exit 1
 fi
 
 print_bt () {
-    # find newest core file
-    COREFILE=$(find . -name "core*" -type f -printf "%T@ %p\n" | sort -k 1 -n 
| cut -d' ' -f 2- | tail -n 1)
+    case "${2-}" in
+        ''|*[!0-9]*) return ;;
+    esac
+    if [ "$2" -le 0 ]; then
+        return
+    fi
+    # CI uses core.%e.%p; also accept core.%p. Only symbolize a core from the
+    # failed test process; a passing death test has a different PID.
+    COREFILE=$(
+        find . \( -name "core.*.$2" -o -name "core.$2" \) -type f -print |

Review Comment:
   Fixed. Lookup now matches cleanup’s current-directory scope. It preserves 
PID filtering and newest-file selection while excluding nested files, 
directories, and symlinks.



##########
test/run_tests.sh:
##########
@@ -39,28 +43,46 @@ for test_bin in $test_bins; do
         failed_test="$test_bin"
         break;
     fi
-done
+done 3<&0

Review Comment:
   Declined as duplicate style suggestions. Loop-scoped redirection 
automatically restores FD 3 after completion or break, without manual cleanup.



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