Commit 87afc01e authored by Michal Berger's avatar Michal Berger Committed by Konrad Sztyber
Browse files

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: default avatarMichal Berger <michal.berger@intel.com>
Change-Id: I106357175028849ba037c9ee78c1e22a772fdfa3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14675


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarwanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 3e5fc847
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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")))