GNU bug report logs - #21432
25.0.50; file-notify-rm-watch (inotify) errors if watched dir is deleted

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tsdh <at> gnu.org>

Date: Tue, 8 Sep 2015 06:37:01 UTC

Severity: normal

Found in version 25.0.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #74 received at 21432 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 21432 <at> debbugs.gnu.org, tsdh <at> gnu.org
Subject: Re: bug#21432: 25.0.50;
 file-notify-rm-watch (inotify) errors if watched dir is deleted
Date: Tue, 15 Sep 2015 15:51:16 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: tsdh <at> gnu.org,  21432 <at> debbugs.gnu.org
> Date: Tue, 15 Sep 2015 13:54:08 +0200
> 
> It isn't clear to me why `file-notify--test-event-handler' hasn't
> been called for your test file. That must be something in
> w32notify.c.

What kind of "something"?  Notifications do work, and the rest of the
tests pass.  So it must be something with this particular test.

I think the problem is due to the fact that the directory is deleted
inside the file-notify--test-with-events form: doing that invalidates
the watch, so the events are not reported.  If I remove this line from
the macro body:

          (delete-directory temporary-file-directory t)

then the notifications are received as expected:

  Test file-notify-test04-file-validity condition:
      (ert-test-failed
       ((should
	 (equal '...
	  (mapcar ... events)))
	:form
	(equal
	 (created changed deleted)
	 (created changed))
	:value nil :explanation
	(proper-lists-of-different-length 3 2
					  (created changed deleted)
					  (created changed)
					  first-mismatch-at 2)))


(There's no "deleted" because it's caused by delete-directory call
which I removed.)

So I modified the test to have the directory deletion outside of the
macro, and the test now passes.  I also increased the timeout of
read-event, because 0.1 was borderline: it sometimes worked and
sometimes didn't.

Please see if the modified tests work with inotify (they did for me on
GNU/Linux).




This bug report was last modified 9 years and 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.