From 87afc01e5a9457218c6b7341ab7f3d193c27a4a4 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Mon, 26 Sep 2022 15:56:30 +0200 Subject: [PATCH] test/dd: Wait 1s before checking the noatime flag This test has been recently failing in a way where atime is not updated within the stat's %X resolution. Add simple sleep to mitigate that. Fixes issue: #2720. Signed-off-by: Michal Berger Change-Id: I106357175028849ba037c9ee78c1e22a772fdfa3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14675 Tested-by: SPDK CI Jenkins Reviewed-by: wanghailiang Reviewed-by: Krzysztof Karas Reviewed-by: Konrad Sztyber Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- test/dd/posix.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/dd/posix.sh b/test/dd/posix.sh index 15346d8d3..d561df4a6 100755 --- a/test/dd/posix.sh +++ b/test/dd/posix.sh @@ -56,6 +56,11 @@ noatime() { atime_if=$(stat --printf="%X" "$test_file0") atime_of=$(stat --printf="%X" "$test_file1") + # Make sure atime has a chance to be updated - if all tests finish within + # 1s (see %X) we may get a false negative at the last check. See: + # https://github.com/spdk/spdk/issues/2720 + sleep 1 + "${DD_APP[@]}" --if="$test_file0" --iflag=noatime --of="$test_file1" ((atime_if == $(stat --printf="%X" "$test_file0"))) ((atime_of == $(stat --printf="%X" "$test_file1")))