stat -c '%Y' report seconds as int, so the delta 2.01s may result as 3s. Signed-off-by: Wang Yugui <wangyugui@xxxxxxxxxxxx> --- tests/generic/297 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/generic/297 b/tests/generic/297 index 6bdc3e1c..e3082202 100755 --- a/tests/generic/297 +++ b/tests/generic/297 @@ -51,7 +51,7 @@ for i in $(seq 0 $fnr); do touch $TEST_DIR/after before=$(stat -c '%Y' $TEST_DIR/before) after=$(stat -c '%Y' $TEST_DIR/after) - delta=$((after - before)) + delta=$((after - before -1)) # 2.01s may result as 3s; so -1 test $delta -gt $timeout && break done @@ -64,7 +64,7 @@ $TIMEOUT_PROG -s INT ${kill_after}s $XFS_IO_PROG -f -c "reflink $testdir/file1 0 touch $TEST_DIR/after before=$(stat -c '%Y' $TEST_DIR/before) after=$(stat -c '%Y' $TEST_DIR/after) -delta=$((after - before)) +delta=$((after - before - 1)) # 2.01s may result as 3s; so -1 echo "reflink of $n bytes took $delta seconds" >> $seqres.full test $delta -gt $timeout && _fail "reflink didn't stop in time, n=$n t=$delta" -- 2.36.1