From: Erwan Velu Date: Wed, 16 Mar 2016 13:24:04 +0000 (+0100) Subject: tests: Adding parallelism for sequential ceph-dencoder calls X-Git-Tag: v10.1.1~3^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d66c852b4656835ec3777cf58dc1bcd8a253f906;p=ceph.git tests: Adding parallelism for sequential ceph-dencoder calls The current code was running sequentially two ceph-dencoder calls. This process is executed pretty fast but adding sequentiality and by the number of loops to execute, it have a cost. This patch is just making this two calls being run in parallel. As a result, the test/encoding/readable.sh test is running in 4m50 instead of 6. The associate loadavg isn't impacted as it stays at 6 while being run with nproc=8. This patch save 1/6th of building time without impact the loadavg. Signed-off-by: Erwan Velu --- diff --git a/src/test/encoding/readable.sh b/src/test/encoding/readable.sh index 774cd94227ec..42cacb429753 100755 --- a/src/test/encoding/readable.sh +++ b/src/test/encoding/readable.sh @@ -86,14 +86,18 @@ test_object() { continue fi; + ./ceph-dencoder type $type import $vdir/objects/$type/$f decode dump_json > $tmp1 & + pid1="$!" + ./ceph-dencoder type $type import $vdir/objects/$type/$f decode encode decode dump_json > $tmp2 & + pid2="$!" #echo "\t$vdir/$type/$f" - if ! ./ceph-dencoder type $type import $vdir/objects/$type/$f decode dump_json > $tmp1; then + if ! wait $pid1; then echo "**** failed to decode $vdir/objects/$type/$f ****" failed=$(($failed + 1)) rm -f $tmp1 $tmp2 continue fi - if ! ./ceph-dencoder type $type import $vdir/objects/$type/$f decode encode decode dump_json > $tmp2; then + if ! wait $pid2; then echo "**** failed to decode+encode+decode $vdir/objects/$type/$f ****" failed=$(($failed + 1)) rm -f $tmp1 $tmp2