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