]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
tests: Optimizing wait_for_clean()
authorErwan Velu <erwan@redhat.com>
Mon, 21 Mar 2016 10:30:13 +0000 (11:30 +0100)
committerErwan Velu <erwan@redhat.com>
Tue, 5 Apr 2016 07:36:25 +0000 (09:36 +0200)
commit84197f16415fe0727d417ff2233ab923e69f4734
tree609b1d767dad046e8533e31c4342324f878442af
parentb3f7392d9d572e92b835d0069993e633d68d5f1b
tests: Optimizing wait_for_clean()

wait_for_clean() is a very common call when running the make check.
It does wait the cluster to be stable before continuing.

This script was doing the same calls twice and could be optimized by
making the useful calls only once.

is_clean() function was checking num_pgs & get_num_active_clean()
The main loop itself was also calling get_num_active_clean()

This patch is inlining the is_clean() inside this loop to benefit from a
single get_num_active_clean() call. This avoid a useless call of (ceph +
xmlstarlet).

This patch does move all the 'timer reset' conditions into an else
avoiding spawning other ceph+xmlstarlet call while we already know we
should reset the timer.

The last modification is to reduce the sleeping time as the state of the
cluster is changing very fast.

This whole patch could looks like almost not a big win but for a test
like test/osd/osd-scrub-repair.sh, we drop from 9m56 to 9m30 while
reducing the number system calls.

At the scale of make check, that's a lot of saving.

Signed-off-by: Erwan Velu <erwan@redhat.com>
qa/workunits/ceph-helpers.sh