From 169610c85d144003e074565e95a2478f91ee2e81 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Tue, 28 Apr 2026 22:27:33 +0200 Subject: [PATCH] fix(argo): wrap TEST_BIN pipeline in subshell + || true to suppress SIGPIPE `set -o pipefail` + `head -1` closing stdin produces SIGPIPE (exit 141) from upstream `ls`/`grep`. The subshell + || true contains the failure to the inner pipeline so the script's pipefail doesn't propagate it. Sanitizer fired exit 141 immediately after the cargo build; nsys reproduced the same exit on its parallel run, confirming the diagnosis. --- infra/k8s/argo/nsys-test-template.yaml | 5 +++-- infra/k8s/argo/sanitizer-test-template.yaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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