diff --git a/infra/k8s/argo/nsys-test-template.yaml b/infra/k8s/argo/nsys-test-template.yaml index b5be4bc9b..ea2a1cb14 100644 --- a/infra/k8s/argo/nsys-test-template.yaml +++ b/infra/k8s/argo/nsys-test-template.yaml @@ -215,10 +215,11 @@ spec: # Honour CARGO_TARGET_DIR — outputs go to ${CARGO_TARGET_DIR}/release/deps, # NOT the repo-relative target/. (CI workflow sets CARGO_TARGET_DIR=/cargo-target.) + # Subshell + || true wraps the head -1 SIGPIPE so pipefail doesn't fire. TARGET_DIR="${CARGO_TARGET_DIR:-target}" - TEST_BIN=$(ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \ + TEST_BIN=$( (ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \ | grep -vE '\.(d|rcgu|rmeta|rlib|so|json)$' \ - | head -1) + | head -1) || true ) if [ -z "$TEST_BIN" ] || [ ! -x "$TEST_BIN" ]; then echo "ERROR: could not locate compiled test binary in $TARGET_DIR/release/deps/" ls -la "$TARGET_DIR/release/deps/" 2>&1 | head -20 diff --git a/infra/k8s/argo/sanitizer-test-template.yaml b/infra/k8s/argo/sanitizer-test-template.yaml index 7bbf6dfcc..40b57d15b 100644 --- a/infra/k8s/argo/sanitizer-test-template.yaml +++ b/infra/k8s/argo/sanitizer-test-template.yaml @@ -203,10 +203,11 @@ spec: # Locate the freshest ml-* test binary # Honour CARGO_TARGET_DIR — outputs go to ${CARGO_TARGET_DIR}/release/deps, # NOT the repo-relative target/. (CI workflow sets CARGO_TARGET_DIR=/cargo-target.) + # Subshell + || true wraps the head -1 SIGPIPE so pipefail doesn't fire. TARGET_DIR="${CARGO_TARGET_DIR:-target}" - TEST_BIN=$(ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \ + TEST_BIN=$( (ls -t "$TARGET_DIR/release/deps/ml-"* 2>/dev/null \ | grep -vE '\.(d|rcgu|rmeta|rlib|so|json)$' \ - | head -1) + | head -1) || true ) if [ -z "$TEST_BIN" ] || [ ! -x "$TEST_BIN" ]; then echo "ERROR: could not locate compiled test binary in $TARGET_DIR/release/deps/" ls -la "$TARGET_DIR/release/deps/" 2>&1 | head -20