From a32d6d79a3f1e30401aa7077949ff4c38e967587 Mon Sep 17 00:00:00 2001 From: Mike McGreevy Date: Fri, 5 Nov 2010 16:48:17 -0500 Subject: [svn-r19739] Purpose: Adjust flush/refresh tests to allow more time for completion, and fix a bug that caused a race condition between the test script and a process it invokes. Description: Flush/refresh testing slows down considerably with multiple (other) processes running in the background, such as the case when -j option is supplied to gmake when running the test suite. I've extended the amount of time before the test times out due to not receiving a signal, and modified the script so that the timer now resets after receiving a signal so it is not a cumulative timer for the entire test, but rather only per verification process that the script needs to spawn. Additionally, I changed the way the test script detected that a signal from a process was ready by changing detection from 'file exists' to 'non-empty file exists'. This test may need to undergo further tweaking once we get a feeling for how well it currently runs in a number of different scenarios, particularly with regards to how the script and the processes it spawns communicate with each other. Tested: amani, using 'gmake -j 8 check'. h5committest --- test/flushrefresh.c | 2 +- test/testflushrefresh.sh.in | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/flushrefresh.c b/test/flushrefresh.c index aa7cf20..c79b445 100755 --- a/test/flushrefresh.c +++ b/test/flushrefresh.c @@ -44,7 +44,7 @@ #define SIGNAL_FROM_SCRIPT "flushrefresh_VERIFICATION_DONE" /* Signal Timeout Length in Secs */ -#define SIGNAL_TIMEOUT 100 +#define SIGNAL_TIMEOUT 300 /* Paths to Various Objects in the Testfile */ #define RG "/" diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index ca34ebe..2d8da8c 100755 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -54,7 +54,7 @@ pid_main=$! # ================================================= startsignal=flushrefresh_VERIFICATION_START endsignal=flushrefresh_VERIFICATION_DONE -timeout_length=100 +timeout_length=300 timedout=0 verification_done=0 @@ -62,12 +62,11 @@ verification_done=0 # Run flush verification on test program. # ======================================= -# start timer -before=`date +%s` until [ $verification_done -eq 1 ]; do # Wait for signal from test program that verification routine can run. - until [ -f $startsignal ]; do + before=`date +%s` + until [ -s $startsignal ]; do after=`date +%s` timediff=`expr $after - $before` if [ $timediff -gt $timeout_length ]; then @@ -103,12 +102,11 @@ done # Run refresh verification on test program. # ========================================= if [ $timedout -eq 0 ]; then - # start timer - before=`date +%s` until [ $verification_done -eq 2 ]; do # Wait for signal from test program that verification routine can run. - until [ -f $startsignal ]; do + before=`date +%s` + until [ -s $startsignal ]; do after=`date +%s` timediff=`expr $after - $before` if [ $timediff -gt $timeout_length ]; then -- cgit v0.12