From 7f61f12d910291676dc5a90e2b9bf7874d58843b Mon Sep 17 00:00:00 2001 From: Loys Ollivier Date: Thu, 14 Dec 2017 11:31:20 +0100 Subject: jjb/common: Fix race condition when using grep and tr when using grep + tr to find board availability, status, a race condition happens sometimes. When it happens the job is stuck and timeout fails. Fix it by calling sequentially grep then tr and not piping. Change-Id: Ib1322e280900b62abdd827992b42183024cd094c Signed-off-by: Loys Ollivier --- jjb/common/include-agl-lava-jobs-submit.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'jjb/common/include-agl-lava-jobs-submit.sh') diff --git a/jjb/common/include-agl-lava-jobs-submit.sh b/jjb/common/include-agl-lava-jobs-submit.sh index 217e8da9..3703ce5b 100644 --- a/jjb/common/include-agl-lava-jobs-submit.sh +++ b/jjb/common/include-agl-lava-jobs-submit.sh @@ -31,7 +31,8 @@ job_id=$(grep "submitted as job:" $JOB_STATUS | sed 's/.*\/\([0-9]*$\)/\1/') lava-tool job-details $full_url $job_id | tee $JOB_STATUS IFS=':' -line=$(grep "^status:" $JOB_STATUS | tr -d '[:space:]') +line=$(grep "^status:" $JOB_STATUS) +line=$(echo "$line" | tr -d '[:space:]') arr=($line) status=${arr[1]} IFS=${OFS} -- cgit 1.2.3-korg