From 206db60c884a9f96342d8c3f91f8b2f0101a716a Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Thu, 10 Oct 2013 11:46:54 -0400 Subject: [PATCH 1/1] LU-1458 tests: wait for dbench to start 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 Change-Id: Ic9c61b487c4013cccd620491d617c10e2206fd62 Reviewed-on: http://review.whamcloud.com/7914 Tested-by: Hudson Reviewed-by: Bobi Jam Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/lustre-rsync-test.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/tests/lustre-rsync-test.sh b/lustre/tests/lustre-rsync-test.sh index 416ced3..84050d5 100644 --- a/lustre/tests/lustre-rsync-test.sh +++ b/lustre/tests/lustre-rsync-test.sh @@ -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 -- 1.8.3.1