From: Darrick J. Wong <djwong@xxxxxxxxxx> This test races multiple FITRIM calls against multiple programs creating 200k small files to ensure that there are no concurrency problems with the allocator and the FITRIM code. This is not necessarily quick, and the test itself does not contain any upper bound on the runtime. On my system that simulates storage with DRAM this takes ~5 minutes to run; on my cloud system with newly provided discard support, I killed the test after 27 hours. Constrain the runtime to about the customary 30s * TIME_FACTOR. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- tests/generic/038 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/generic/038 b/tests/generic/038 index 5c014ae389..e1176292fb 100755 --- a/tests/generic/038 +++ b/tests/generic/038 @@ -100,6 +100,8 @@ nr_files=$((50000 * LOAD_FACTOR)) create_files() { local prefix=$1 + local now=$(date '+%s') + local end_time=$(( now + (TIME_FACTOR * 30) )) for ((n = 0; n < 4; n++)); do mkdir $SCRATCH_MNT/$n @@ -113,6 +115,10 @@ create_files() echo "Failed creating file $n/${prefix}_$i" >>$seqres.full break fi + if [ "$(date '+%s')" -ge $end_time ]; then + echo "runtime exceeded @ $i files" >> $seqres.full + break + fi done ) & create_pids[$n]=$!