* [PATCH blktests] block/005,008: do exit if fio did not finish within timeout
@ 2019-05-07 5:47 Xiao Liang
2019-05-10 18:20 ` Chaitanya Kulkarni
0 siblings, 1 reply; 2+ messages in thread
From: Xiao Liang @ 2019-05-07 5:47 UTC (permalink / raw)
To: linux-block, osandov; +Cc: xiliang
In some bad situation, fio needs taking over several hours to complete
random read operations with specipied size. The test may skip out in such
cases and does not block other cases run.
With this patch, the case will be ended within $TIMEOUT(if set) or 900s.
block/005 => nvme1n1 (switch schedulers while doing IO) [failed]
runtime ... 1800.477s
read iops ...
--- tests/block/005.out 2019-03-31 14:29:39.905449312 +0000
+++ /home/ec2-user/blktests/results/nvme1n1/block/005.out.bad 2019-05-07 04:10:16.026681842 +0000
@@ -1,2 +1,4 @@
Running block/005
+fio did not finish after 900 seconds which probably caused by
+lower disk performance
Test complete
Signed-off-by: Xiao Liang <xiliang@redhat.com>
---
tests/block/005 | 10 ++++++++++
tests/block/008 | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/tests/block/005 b/tests/block/005
index 8ab6791..96b16a4 100755
--- a/tests/block/005
+++ b/tests/block/005
@@ -31,10 +31,20 @@ 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 on some bad
+ # performance disks. 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 which probably caused by
+lower disk performance"
+ break
+ fi
done
FIO_PERF_FIELDS=("read iops")
diff --git a/tests/block/008 b/tests/block/008
index 4a88056..c25b908 100755
--- a/tests/block/008
+++ b/tests/block/008
@@ -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 on some bad
+ # performance disks. 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,12 @@ 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 which probably caused by
+lower disk performance"
+ break
+ fi
done
FIO_PERF_FIELDS=("read iops")
--
2.17.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH blktests] block/005,008: do exit if fio did not finish within timeout
2019-05-07 5:47 [PATCH blktests] block/005,008: do exit if fio did not finish within timeout Xiao Liang
@ 2019-05-10 18:20 ` Chaitanya Kulkarni
0 siblings, 0 replies; 2+ messages in thread
From: Chaitanya Kulkarni @ 2019-05-10 18:20 UTC (permalink / raw)
To: Xiao Liang, linux-block, osandov
Hi Xiao,
I like to idea of not blocking the other tests. Couple of comments below.
On 05/06/2019 10:47 PM, Xiao Liang wrote:
> In some bad situation, fio needs taking over several hours to complete
> random read operations with specipied size. The test may skip out in such
> cases and does not block other cases run.
s/specipied/specified/
>
> With this patch, the case will be ended within $TIMEOUT(if set) or 900s.
> block/005 => nvme1n1 (switch schedulers while doing IO) [failed]
> runtime ... 1800.477s
> read iops ...
> --- tests/block/005.out 2019-03-31 14:29:39.905449312 +0000
> +++ /home/ec2-user/blktests/results/nvme1n1/block/005.out.bad 2019-05-07 04:10:16.026681842 +0000
> @@ -1,2 +1,4 @@
> Running block/005
> +fio did not finish after 900 seconds which probably caused by
> +lower disk performance
> Test complete
>
> Signed-off-by: Xiao Liang <xiliang@redhat.com>
> ---
> tests/block/005 | 10 ++++++++++
> tests/block/008 | 10 ++++++++++
> 2 files changed, 20 insertions(+)
>
> diff --git a/tests/block/005 b/tests/block/005
> index 8ab6791..96b16a4 100755
> --- a/tests/block/005
> +++ b/tests/block/005
> @@ -31,10 +31,20 @@ 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 on some bad
> + # performance disks. 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 which probably caused by
> +lower disk performance"
Can we make this message more generic instead of calling out disk
performance ?
> + break
> + fi
> done
>
> FIO_PERF_FIELDS=("read iops")
> diff --git a/tests/block/008 b/tests/block/008
> index 4a88056..c25b908 100755
> --- a/tests/block/008
> +++ b/tests/block/008
> @@ -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 on some bad
> + # performance disks. 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,12 @@ 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 which probably caused by
> +lower disk performance"
Same here.
> + break
> + fi
> done
>
> FIO_PERF_FIELDS=("read iops")
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-10 18:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07 5:47 [PATCH blktests] block/005,008: do exit if fio did not finish within timeout Xiao Liang
2019-05-10 18:20 ` Chaitanya Kulkarni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).