all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juanma Barranquero <lekktu@gmail.com>,
	Michael Albinus <michael.albinus@gmx.de>
Cc: 25539@debbugs.gnu.org
Subject: bug#25539: 26.0.50; filenotify-tests.el fails on Windows (32 and 64 bits)
Date: Thu, 26 Jan 2017 18:33:00 +0200	[thread overview]
Message-ID: <837f5h3hoj.fsf@gnu.org> (raw)
In-Reply-To: <CAAeL0SQMs14HWpLKdF8Gq_dK+cR0sn21Nqga83HFjkSSZ_zPLg@mail.gmail.com> (message from Juanma Barranquero on Thu, 26 Jan 2017 01:03:09 +0100)

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Thu, 26 Jan 2017 01:03:09 +0100
> 
> 4 unexpected results:
> FAILED file-notify-test04-file-validity
> FAILED file-notify-test05-dir-validity
> FAILED file-notify-test06-many-events
> FAILED file-notify-test08-watched-file-in-watched-dir

The problem is in file-notify--test-cleanup-p, and it happens only
when the parent directory of the file(s) being watched is deleted.

The root cause is that file-notify--test-cleanup-p expects the
notification descriptor(s) to be deleted from the hash table
maintained internally by filenotify.el, when the above happens.  But
that doesn't work on Windows, where deleting the parent directory
simply causes an error whose result is that the thread which watches
the filesystem changes exits abnormally, but the event is not
reported.  So in those cases the descriptor is not removed from the
hash table.

The changes below make the tests succeed, but maybe the above means we
need to augment the w32notify implementation to clean up better in
this case.  Michael?

diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index d237d0c..5d31251 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -850,6 +850,8 @@ file-notify--test-with-events
 	;; After deleting the parent directory, the descriptor must
 	;; not be valid anymore.
 	(should-not (file-notify-valid-p file-notify--test-desc))
+        (if (eq system-type 'windows-nt)
+            (file-notify--rm-descriptor file-notify--test-desc))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))
@@ -906,6 +908,8 @@ file-notify--test-with-events
 	 (file-notify--test-timeout)
 	 (not (file-notify-valid-p file-notify--test-desc)))
         (should-not (file-notify-valid-p file-notify--test-desc))
+        (if (eq system-type 'windows-nt)
+            (file-notify--rm-descriptor file-notify--test-desc))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))
@@ -975,6 +979,8 @@ file-notify--test-with-events
             (file-notify--test-read-event)
             (delete-file file)))
         (delete-directory file-notify--test-tmpfile)
+        (if (eq system-type 'windows-nt)
+            (file-notify--rm-descriptor file-notify--test-desc))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))
@@ -1184,6 +1190,9 @@ file-notify--test-with-events
           (delete-directory file-notify--test-tmpfile 'recursive))
         (should-not (file-notify-valid-p file-notify--test-desc1))
         (should-not (file-notify-valid-p file-notify--test-desc2))
+        (when (eq system-type 'windows-nt)
+          (file-notify--rm-descriptor file-notify--test-desc1)
+          (file-notify--rm-descriptor file-notify--test-desc2))
 
         ;; The environment shall be cleaned up.
         (file-notify--test-cleanup-p))





  reply	other threads:[~2017-01-26 16:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26  0:03 bug#25539: 26.0.50; filenotify-tests.el fails on Windows (32 and 64 bits) Juanma Barranquero
2017-01-26 16:33 ` Eli Zaretskii [this message]
2017-01-27  7:54   ` Michael Albinus
2017-01-27  8:31     ` Eli Zaretskii
2019-10-01 22:03       ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837f5h3hoj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25539@debbugs.gnu.org \
    --cc=lekktu@gmail.com \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.