Merge pull request #2918 from aale24/fix-test-format-newc-race
Fix test_format_newc timestamp race condition
(cherry picked from commit ba387256e0)
This commit is contained in:
1 parent
1b38a23a53
commit
be3df30fd2
1 file changed
+1
-1
@@ -198,7 +198,7 @@ DEFINE_TEST(test_format_newc)
|
||||
t = from_hex(e + 46, 8); /* mtime */
|
||||
failure("t=%#08jx now=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now,
|
||||
(intmax_t)now);
|
||||
assert(t <= now); /* File wasn't created in future. */
|
||||
assert(t <= now + 1); /* Allow 1 sec margin for timing variations. */
|
||||
failure("t=%#08jx now - 2=%#08jx=%jd", (uintmax_t)t, (uintmax_t)now - 2,
|
||||
(intmax_t)now - 2);
|
||||
assert(t >= now - 2); /* File was created w/in last 2 secs. */
|
||||
|
||||
Reference in new issue
Block a user