From: Erwan Velu Date: Thu, 24 Mar 2016 14:26:55 +0000 (+0100) Subject: tests: Removing one ceph-dencoder call in check-generated.sh X-Git-Tag: v10.1.1~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8131%2Fhead;p=ceph.git tests: Removing one ceph-dencoder call in check-generated.sh The first ceph-dencoder call is very unlikely to fail and represent a bottleneck as the parallel computation are only done one this test is completed. The idea of this patch is to run immediately the 4 dencoders process in parallel and check the resulting error code. If one fail then we report the failure. As the failure is very unlikely, that saves time and makes the code simplier too. Signed-off-by: Erwan Velu --- diff --git a/src/test/encoding/check-generated.sh b/src/test/encoding/check-generated.sh index f61dc1b2d6e..ee55fab0419 100755 --- a/src/test/encoding/check-generated.sh +++ b/src/test/encoding/check-generated.sh @@ -19,13 +19,6 @@ for type in `./ceph-dencoder list_types`; do num=`./ceph-dencoder type $type count_tests` echo "$num $type" for n in `seq 1 1 $num 2>/dev/null`; do - if ! ./ceph-dencoder type $type select_test $n encode decode; then - echo "**** $type test $n encode+decode check failed ****" - echo " ceph-dencoder type $type select_test $n encode decode" - failed=$(($failed + 3)) - continue - fi - safe_type=$type # BitVector<2> needs some escaping to avoid bash issues with <> if [ "$type" = "BitVector<2>" ]; then @@ -39,6 +32,13 @@ for type in `./ceph-dencoder list_types`; do run_in_background pids bash -c "./ceph-dencoder type $safe_type select_test $n copy_ctor dump_json > $tmp4" wait_background pids + if [ $? -ne 0 ]; then + echo "**** $type test $n encode+decode check failed ****" + echo " ceph-dencoder type $type select_test $n encode decode" + failed=$(($failed + 3)) + continue + fi + # nondeterministic classes may dump nondeterministically. compare # the sorted json output. this is a weaker test, but is better # than nothing.