]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: Adding parallelism for sequential ceph-dencoder calls
authorErwan Velu <erwan@redhat.com>
Wed, 16 Mar 2016 13:24:04 +0000 (14:24 +0100)
committerErwan Velu <erwan@redhat.com>
Tue, 5 Apr 2016 07:36:25 +0000 (09:36 +0200)
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 <erwan@redhat.com>
src/test/encoding/readable.sh

index 774cd94227ecf713aa2ab7768a70acea4e0321fd..42cacb4297537c894259f6ef57f559239175d0af 100755 (executable)
@@ -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