]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: Removing one ceph-dencoder call in check-generated.sh 8131/head
authorErwan Velu <erwan@redhat.com>
Thu, 24 Mar 2016 14:26:55 +0000 (15:26 +0100)
committerErwan Velu <erwan@redhat.com>
Tue, 5 Apr 2016 07:36:26 +0000 (09:36 +0200)
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 <erwan@redhat.com>
src/test/encoding/check-generated.sh

index f61dc1b2d6ee60d66565355244b6f796d977f22e..ee55fab0419e5cc994a56b116607ae72bd8aae0b 100755 (executable)
@@ -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.