From ab2913a29fec4d4acef7edcf2410ae2b902454b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 8 Mar 2018 15:40:18 +0100 Subject: [PATCH] Tweak timestamp checking in the cds system test Given the characteristics of the three timestamps involved in file modification time checks in the cds system test (each one is an hour apart from the next), reduce the resolution of these checks to 1 minute. This will prevent intermittent false negatives caused by exceeding the currently allowed difference of 9 seconds between file modification times without making the test moot. Also note that by using abs(), checkmtime.pl allows the cds system test to pass when the modification time of the checked file is less than an hour (or two hours for the second check) in the past. This should never happen, so remove abs() from the condition checked by checkmtime.pl. --- bin/tests/system/cds/checkmtime.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tests/system/cds/checkmtime.pl b/bin/tests/system/cds/checkmtime.pl index aba2105c03..a65938c432 100644 --- a/bin/tests/system/cds/checkmtime.pl +++ b/bin/tests/system/cds/checkmtime.pl @@ -13,4 +13,4 @@ my $target = shift; my $file = shift; my $mtime = time - (stat $file)[9]; die "bad mtime $mtime" - unless abs($mtime - $target) < 10; + unless ($mtime - $target >= 0 && $mtime - $target < 60);