Patchworkβ Repeatability when copying a whole directory into a new one.

login
register
about
Submitter Pieter Praet
Date 2011-11-03 16:49:59
Message ID <878vnxp2vc.fsf@praet.org>
Download mbox | patch
Permalink /patch/1448/
State New
Headers show

Comments

Pieter Praet - 2011-11-03 16:49:59
On Mon, 31 Oct 2011 23:59:49 -0300, David Bremner <david@tethera.net> wrote:
> On Fri, 30 Sep 2011 01:26:46 +0200, Thomas Schwinge <thomas@schwinge.name> wrote:
> > This new test currently fails -- but it shouldn't.
> > ---
> > 
> > Hi!
> > 
> > I found this while manually copying directories and running notmuch new.
> > 
> > Am I just too sleepy at this time, or is it another DB vs. directory
> > mtime issue?
> > 
> >      BROKEN Repeatability when copying a whole directory into a new one
> >             --- new.18.expected     2011-09-29 23:23:39.000000000 +0000
> >             +++ new.18.output       2011-09-29 23:23:39.000000000 +0000
> >             @@ -1,2 +1 @@
> >             -Processed 51 total files in almost no time.
> >              No new mail.
> 
> I'm a bit confused here too. When the files are removed, the "notmuch new"
> sent to /dev/null in your test detects the deletes as renames. Shouldn't
> the copies be detected as duplicates or something?
> 

They should.

Applying any one of the attached patches makes the test pass;
I vote "directory mtime issue".
> d
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Peace

Patch

diff --git a/test/new b/test/new
index 0afb04c..f600983 100755
--- a/test/new
+++ b/test/new
@@ -159,7 +159,7 @@  test_begin_subtest 'Repeatability when copying a whole directory into a new one'
 add_email_corpus
 
 mkdir "$MAIL_DIR"/2nd
-cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+cp -a "$MAIL_DIR"/cur/* "$MAIL_DIR"/2nd/
 output1=$(notmuch new)
 
 rm -rf "$MAIL_DIR"/2nd
@@ -167,7 +167,7 @@  notmuch new > /dev/null
 
 # This was quite enjoyable.  Let's do it again.
 mkdir "$MAIL_DIR"/2nd
-cp -a "$MAIL_DIR"/cur "$MAIL_DIR"/2nd/
+cp -a "$MAIL_DIR"/cur/* "$MAIL_DIR"/2nd/
 output2=$(notmuch new)
 
 test_subtest_known_broken