@@ -31,10 +31,19 @@ test_device() {
_run_fio_rand_io --filename="$TEST_DEV" --size="$size" &
# while job is running, switch between schedulers
+ # fio test may take too long time to complete read/write in special size in some bad
+ # situations. Set a timeout here which does not block overall test.
+ start_time=$(date +%s)
+ timeout=${TIMEOUT:=900}
while kill -0 $! 2>/dev/null; do
idx=$((RANDOM % ${#scheds[@]}))
_test_dev_queue_set scheduler "${scheds[$idx]}"
sleep .2
+ end_time=$(date +%s)
+ if (( end_time - start_time > timeout )); then
+ echo "fio did not finish after $timeout seconds!"
+ break
+ fi
done
FIO_PERF_FIELDS=("read iops")
@@ -45,6 +45,10 @@ test_device() {
done
# while job is running, hotplug CPUs
+ # fio test may take too long time to complete read/write in special size in some bad
+ # situations. Set a timeout here which does not block overall test.
+ start_time=$(date +%s)
+ timeout=${TIMEOUT:=900}
while sleep .2; kill -0 $! 2> /dev/null; do
if (( offlining && ${#offline_cpus[@]} == max_offline )); then
offlining=0
@@ -65,6 +69,11 @@ test_device() {
unset offline_cpus["$idx"]
offline_cpus=("${offline_cpus[@]}")
fi
+ end_time=$(date +%s)
+ if (( end_time - start_time > timeout )); then
+ echo "fio did not finish after $timeout seconds!"
+ break
+ fi
done
FIO_PERF_FIELDS=("read iops")