Whamcloud - gitweb
LU-1458 tests: wait for dbench to start 14/7914/3
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Thu, 10 Oct 2013 15:46:54 +0000 (11:46 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 30 Oct 2013 17:10:08 +0000 (17:10 +0000)
Use wait_for_function instead of just guessing that 20s will be long
enough for dbench to start.  Wait for up to 6min in 5 second
intervals.  This also ensures that dbench will run for a little while
after it starts.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Ic9c61b487c4013cccd620491d617c10e2206fd62
Reviewed-on: http://review.whamcloud.com/7914
Tested-by: Hudson
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/lustre-rsync-test.sh

index 416ced3..84050d5 100644 (file)
@@ -233,14 +233,17 @@ run_test 2a "Replicate files created by dbench."
 
 # Test 2b - Replicate files changed by dbench.
 test_2b() {
+       local child_pid
        init_src
        init_changelog
 
        # Run dbench
        sh rundbench -C -D $DIR/$tdir 2 -t $DBENCH_TIME &
-       sleep 20
+       # wait for dbench to start
+       wait_for_function 'child_pid=$(pgrep dbench)' 360
+       # let dbench run for a bit
+       sleep 10
 
-       local child_pid=$(pgrep dbench)
        echo PIDs: $child_pid
        echo Stopping dbench
        $KILL -SIGSTOP $child_pid