test-stat-time: avoid more spurious failures
authorEric Blake <ebb9@byu.net>
Sat, 10 Oct 2009 14:04:41 +0000 (08:04 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 10 Oct 2009 14:21:18 +0000 (08:21 -0600)
commit3776abf877797beed1792833c77ceb6ae1633e21
tree25591eba821296a86f3db646d9837794895549cf
parentd93391bffb3c76c651161b5b8c199c358bc6256a
test-stat-time: avoid more spurious failures

On xfs, although timestamps can have a full nanosecond resolution,
successive file actions appear to be quantized to approximately
10 millisecond windows.  Running with just 1 ms delays could
cause two actions to fall in the same window, leading to sporadic
failures on a fast enough machine.  Slow down to prevent this.

On ext2, timestamps only have 1 second resolution, but if the
first timestamp was made at 1.95 and the second at 2.10, then
the two files appear 1 second apart, and the shorter delay was
used, causing spurious failures.  Require that the observable
difference lie within the same second, using a second try if
necessary, to prevent this.

* tests/test-stat-time.c (nap): Wait for 15ms rather than 2ms, for
xfs; and avoid race if the two timestamps cross quantization edge.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
tests/test-stat-time.c