From 0f4d23e3cd673d43905b51dd8358eaef25876557 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Wed, 30 Sep 2026 04:13:26 +0000 Subject: [PATCH] fix(frontend-test): regression suite accepts dashed job IDs and no longer hangs on stdin (bug-1765) xcecli prints a submitted job's ID in the dashed {cluster}-{apiserver}-{timestamp}-{sequence} form (format.FormatJobID, since d6008ead), but run.sh still matched 'Job <[0-9]+>' -- so 'jobs submit' always failed and 'jobs kill' was skipped (28/1/1). It also extracted the ID with [0-9]{10,}, which would have picked out only the timestamp. Match the dashed form and take the whole ID from between the angle brackets; 'jobs kill' accepts it back. 'jobs submit' reads a job script from stdin whenever stdin is a pipe, so the suite hung forever when run from a script or CI with an open pipe; the submit now reads /dev/null. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/frontend/tests/regression/run.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/frontend/tests/regression/run.sh b/src/frontend/tests/regression/run.sh index 68dcc3aa..20b87582 100755 --- a/src/frontend/tests/regression/run.sh +++ b/src/frontend/tests/regression/run.sh @@ -138,11 +138,15 @@ assert_contains "queues deactive" "deactive" $XCE queues deactive nor echo "" echo "--- Jobs ---" -# submit returns a job ID -SUBMIT_OUT=$($XCE jobs submit -J regression_test -q normal sleep 1 2>&1) -if echo "$SUBMIT_OUT" | grep -qE "Job <[0-9]+> is submitted"; then +# submit returns a job ID, printed in xcecli's dashed form +# {cluster}-{apiserver}-{timestamp}-{sequence} (format.FormatJobID), which +# `jobs kill` accepts back (bug-1765: this used to expect plain digits). +# stdin is /dev/null: `jobs submit` reads a job script from stdin whenever it +# is a pipe, so run from a script or CI with an open pipe it waited forever. +SUBMIT_OUT=$($XCE jobs submit -J regression_test -q normal sleep 1 &1) +if echo "$SUBMIT_OUT" | grep -qE "Job <[0-9]+(-[0-9]+){3}> is submitted"; then pass "jobs submit" - JOB_ID=$(echo "$SUBMIT_OUT" | grep -oE '[0-9]{10,}' | head -1) + JOB_ID=$(echo "$SUBMIT_OUT" | sed -nE 's/.*Job <([0-9]+(-[0-9]+){3})> is submitted.*/\1/p' | head -1) else fail "jobs submit" "unexpected output: $SUBMIT_OUT" JOB_ID=""