about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-12 11:58:15 +0000
committerEric Wong <e@80x24.org>2021-09-12 12:01:24 +0000
commitdc489bfd4b4c659b7ebb166ab540b4e767e51aaa (patch)
tree3cc77bc3da1bb325674571e475e65bedfc7cd86a /t
parent3937f58b74e4b764e76ade523fec8497aa1b0611 (diff)
downloadpublic-inbox-dc489bfd4b4c659b7ebb166ab540b4e767e51aaa.tar.gz
Timestamp comparisons only have 1 second granularity, which
isn't nearly enough for our test cases, and probably not for
real world use for "git send-email" bursts and fast SMTP
servers.

We'll continue to check modification times inside the manifest,
though, in case an extremely rare SHA-1 collision is found...
Diffstat (limited to 't')
-rw-r--r--t/lei-mirror.t14
-rw-r--r--t/v2mirror.t4
2 files changed, 9 insertions, 9 deletions
diff --git a/t/lei-mirror.t b/t/lei-mirror.t
index 7db49e15..4f4c49c1 100644
--- a/t/lei-mirror.t
+++ b/t/lei-mirror.t
@@ -91,30 +91,34 @@ SKIP: {
         my $opt = { -C => $d, 2 => \(my $err) };
         ok(!run_script([qw(-clone -q), "$http/404"], undef, $opt), '404 fails');
         ok(!-d "$d/404", 'destination not created');
-        delete $opt->{2};
 
         ok(run_script([qw(-clone -q -C), $d, "$http/t2"], undef, $opt),
                 '-clone succeeds on v2');
         ok(-d "$d/t2/git/0.git", 'epoch cloned');
         ok(-f "$d/t2/manifest.js.gz", 'manifest saved');
         ok(!-e "$d/t2/mirror.done", 'no leftover mirror.done');
-        ok(run_script([qw(-fetch -q -C), "$d/t2"], undef, $opt),
+        ok(run_script([qw(-fetch -C), "$d/t2"], undef, $opt),
                 '-fetch succeeds w/ manifest.js.gz');
+        unlike($err, qr/git fetch/, 'no fetch done w/ manifest');
         unlink("$d/t2/manifest.js.gz") or xbail "unlink $!";
-        ok(run_script([qw(-fetch -q -C), "$d/t2"], undef, $opt),
+        ok(run_script([qw(-fetch -C), "$d/t2"], undef, $opt),
                 '-fetch succeeds w/o manifest.js.gz');
+        like($err, qr/git fetch/, 'fetch forced w/o manifest');
 
         ok(run_script([qw(-clone -q -C), $d, "$http/t1"], undef, $opt),
                 'cloning v1 works');
         ok(-d "$d/t1", 'v1 cloned');
         ok(!-e "$d/t1/mirror.done", 'no leftover file');
-        ok(run_script([qw(-fetch -q -C), "$d/t1"], undef, $opt),
+        ok(-f "$d/t1/manifest.js.gz", 'manifest saved');
+        ok(run_script([qw(-fetch -C), "$d/t1"], undef, $opt),
                 'fetching v1 works');
+        unlike($err, qr/git fetch/, 'no fetch done w/ manifest');
         unlink("$d/t1/manifest.js.gz") or xbail "unlink $!";
         my $before = [ glob("$d/t1/*") ];
-        ok(run_script([qw(-fetch -q -C), "$d/t1"], undef, $opt),
+        ok(run_script([qw(-fetch -C), "$d/t1"], undef, $opt),
                 'fetching v1 works w/o manifest.js.gz');
         unlink("$d/t1/FETCH_HEAD"); # git internal
+        like($err, qr/git fetch/, 'no fetch done w/ manifest');
         ok(unlink("$d/t1/manifest.js.gz"), 'manifest created');
         my $after = [ glob("$d/t1/*") ];
         is_deeply($before, $after, 'no new files created');
diff --git a/t/v2mirror.t b/t/v2mirror.t
index b0075fcc..2bb3238b 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -99,10 +99,6 @@ $ibx->cleanup;
 
 my @new_epochs;
 my $fetch_each_epoch = sub {
-        my $mf = "$tmpdir/m/manifest.js.gz";
-        if (my @st = stat($mf)) {
-                utime($st[8], $st[9] - 1, $mf) or xbail "utime $mf: $!";
-        }
         my %before = map { $_ => 1 } glob("$tmpdir/m/git/*");
         run_script([qw(-fetch -q)], undef, {-C => "$tmpdir/m"}) or
                 xbail '-fetch fail';