From d5ec33fc189e54d049c48fe0ce490e4d5300ffa3 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Thu, 24 Mar 2016 15:26:55 +0100 Subject: [PATCH] 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 --- src/test/encoding/check-generated.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/encoding/check-generated.sh b/src/test/encoding/check-generated.sh index f61dc1b2d6ee6..ee55fab0419e5 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. -- 2.47.3