]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tests: avoid a race in tail --retry testing
authorPádraig Brady <P@draigBrady.com>
Mon, 3 Jun 2013 00:29:17 +0000 (01:29 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 3 Jun 2013 13:31:37 +0000 (14:31 +0100)
commiteadf835794d7a4087d9bd366661364d5d8119afa
tree5d36b5955b1faff1ccf5c1ad92e00c45d7c0962c
parente3a34e14f54a117b607c73a7309c2c2c55d5b3a1
tests: avoid a race in tail --retry testing

Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/5221053

* tests/tail-2/retry.sh: Ensure the 'out' file is truncated,
as it's used to arbitrate the run order of commands.
Relying on the truncation in the background tail command
is racy because the truncation can occur after the fork
of the background shell and thus wait4lines would not wait
for output to occur in 'out', which would mean that the
'missing' file could be populated by the time tail(1)
gets to process it.
tests/tail-2/retry.sh