From d66c852b4656835ec3777cf58dc1bcd8a253f906 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Wed, 16 Mar 2016 14:24:04 +0100 Subject: [PATCH] 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 --- src/test/encoding/readable.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/encoding/readable.sh b/src/test/encoding/readable.sh index 774cd94227ecf..42cacb4297537 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 -- 2.39.5