]> git.notmuchmail.org Git - notmuch/commitdiff
test: Fix transient error in 'new' test
authorAustin Clements <amdragon@MIT.EDU>
Mon, 23 Dec 2013 20:20:36 +0000 (15:20 -0500)
committerDavid Bremner <david@tethera.net>
Sat, 28 Dec 2013 13:19:51 +0000 (09:19 -0400)
This fixes a non-deterministic failure in "Ignore files and
directories specified in new.ignore (multiple occurrences)".  The test
assumed that all directories would be scanned, even though nothing
updated the mtime of ${MAIL_DIR}.  It *usually* worked nevertheless
because the tests run quickly enough that the directory mtime is
usually the same as the current time, so notmuch new does not update
the mtime in the database (because more changes could occur in the
same second).  However, when it occasionally did update the mtime in
the database, the notmuch new call in this test would (correctly) skip
"pass 2" of scanning ${MAIL_DIR}, causing it to skip the following
expected lines:

  (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.git
  (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/.ignored_hidden_file
  (D) add_files_recursive, pass 2: explicitly ignoring ${MAIL_DIR}/ignored_file

This patch fixes this problem by touching ${MAIL_DIR} to ensure it
gets scanned and by rearranging the test to ensure the directories are
touched immediately before the main notmuch new call in the test.


No differences found