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) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-30 04:13:26 +00:00
parent a370d72417
commit 0f4d23e3cd
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C

View file

@ -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 </dev/null 2>&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=""