Index: tests/release/tests/itemwait/testconfig ================================================================== --- tests/release/tests/itemwait/testconfig +++ tests/release/tests/itemwait/testconfig @@ -1,20 +1,20 @@ # test2 from the tests/Makefile [var] tname itemwait -[prelaunch-env-vars] +[pre-launch-env-vars] NUMTESTS 20 [ezsteps] # Set things up -clean $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -remove-runs -testpatt % -target % -runname #{get var tname}% -runbigrun3 $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -run -testpatt bigrun3 -target a/bigrun3 -runname #{get var tname} +clean $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -remove-runs -testpatt % -target %/% -runname #{get var tname}% +runbigrun3 $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH nbfake megatest -run -testpatt bigrun3 -target a/bigrun3 -runname #{get var tname} # watchrun watches until it sees at least one RUNNING in bigrun and one PASS in bigrun2 -watchrun watchrun.sh #{get var tname} +watchrun sleep 15;watchrun.sh #{get var tname} [requirements] # waiton #{getenv ALL_TOPLEVEL_TESTS} # This is a "toplevel" test, it does not require waitons to be non-FAIL to run Index: tests/release/tests/itemwait/watchrun.sh ================================================================== --- tests/release/tests/itemwait/watchrun.sh +++ tests/release/tests/itemwait/watchrun.sh @@ -1,22 +1,28 @@ #!/bin/bash runname=$1 -pass=1 -alldone=1 -while ! $alldone;do +pass=no +alldone=no +while [[ $alldone == no ]];do sleep 5 - bigrun_running=$(megatest -list-runs a|egrep 'bigrun\(.*RUNNING'|wc -l) - bigrun2_pass=$(megatest -list-runs a|egrep 'bigrun2.*COMPLETED.*PASS') - if [[ $bigrun_running -gt 0 && $bigrun2_pass -gt 0 ]];then - pass=0 - alldone=0 + $MTRUNNER $MTTESTDIR/fdktestqa/testqa $MTPATH megatest -list-runs $runname > list-runs.log + bigrun_running=$(cat list-runs.log | egrep 'bigrun\(.*RUNNING'|wc -l) + bigrun2_pass=$(cat list-runs.log | egrep 'bigrun2.*COMPLETED.*PASS'|wc -l) + echo "bigrun_running=$bigrun_running, bigrun2_pass=$bigrun2_pass" + if [[ $bigrun_running -gt 0 ]] && [[ $bigrun2_pass -gt 0 ]];then + pass=yes + alldone=yes + fi + if [[ $bigrun_running -eq 0 ]];then + echo "bigrun all done and no bigrun2 found with PASS." + alldone=yes fi done -if $pass;then +if [[ $pass == yes ]];then echo PASS exit 0 else echo FAIL exit 1