]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
tests: Optimizing kill_daemons() sleep time
authorErwan Velu <erwan@redhat.com>
Mon, 21 Mar 2016 11:12:13 +0000 (12:12 +0100)
committerErwan Velu <erwan@redhat.com>
Tue, 5 Apr 2016 07:36:25 +0000 (09:36 +0200)
commit0eea2436d9fd83301c844e87a03433c94a7b3978
tree1652db05c3a2b642768bd092943bbd42c8cdfce6
parent0dccb6c1640cda4423ef5adc703d11c409d8ae51
tests: Optimizing kill_daemons() sleep time

It could sounds like nothing but the actual sleeping rampup is counter
productive.

The code does : kill <proc>; sleep 0; kill <proc>; sleep 0; kill <proc;
sleep 1; and then it grows up 120 seconds by a smooth rampup.

But actually there is almost no chance the process dies so fast meaning
that by default we switch to the sleep 1.

Moving from sleep 0 to sleep 1 doesn't seems a big win but as
kill_daemons() is called very often we can save a lot of time by then
end.

This patch offer to sleep first a 1/10th of second instead of 0 and then
1/20th of second instead of 0.

The sleep call is also moved after the kill call as it's not necessary
waiting before executing the command.

This patch makes the running time of a test like osd-scrub-repair.sh
dropping from 7m30 to 7m7.

Saving another ~30seconds is an interesting win at make check level.
Signed-off-by: Erwan Velu <erwan@redhat.com>
qa/workunits/ceph-helpers.sh