Whamcloud - gitweb
LU-12261 tests: Race between exec and truncate 91/34791/3
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 1 May 2019 19:05:37 +0000 (15:05 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 2 May 2019 01:17:21 +0000 (01:17 +0000)
commitc64855fca1504bddcb0fc7ad7316d8d6b20a9c6f
treec40627979c4907b282b24c0148dd9cf72f33c063
parent6d775021473e53b623cd78f35a4d51e67136918a
LU-12261 tests: Race between exec and truncate

Execing '$tdir/sleep' with & doesn't guarantee the file is
actually open before returning, so it is sometimes losing
the race with truncate, resulting in errors like this:
/usr/lib64/lustre/tests/sanity.sh: line 4172:
/mnt/lustre/d43b.sanity/sleep: Text file busy

Where $tdir/sleep gets ETXTBSY, instead of truncate as
expected.

A 1 second delay should be enough to guarantee exec wins
the race vs truncate.

Test-Parameters: trivial
Test-Parameters: testgroup=review-ldiskfs-arm
Test-Parameters: testgroup=review-ldiskfs
Test-Parameters: testgroup=review-ldiskfs-arm

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Ice6f4567805e64c3be755b6c684b6a086a348dd8
Reviewed-on: https://review.whamcloud.com/34791
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity.sh