GNU bug report logs - #21804
25.0.50; file-notify-tests failure on Cygwin

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Sun, 1 Nov 2015 15:52:02 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


View this message in rfc822 format

From: Ken Brown <kbrown <at> cornell.edu>
To: 21804 <at> debbugs.gnu.org
Subject: bug#21804: 25.0.50; file-notify-tests failure on Cygwin
Date: Mon, 26 Dec 2016 12:08:18 -0500
[Message part 1 (text/plain, inline)]
[Resending after unarchiving the bug.]


On 11/5/2015 2:58 PM, Michael Albinus wrote:
> I've played with this the whole afternoon. Looks like there is no error
> in gfilenotify for Cygwin. But it is a hard job to trigger the file
> notification events to appear such a way they could be checked for
> correctness in the test cases.
>
> Increasing timeouts was necessary. But even this does not make the
> events to appear reliably. One would need to write additional code to
> get every single event one after the other. Waiting for a series of
> events, as the test cases do expect, does not seem to work.

Hi Michael,

I've made some progress on understanding why some file notifications 
aren't triggered in the tests on Cygwin.  One issue is that 
file-notify--test-read-event-timeout has to be increased drastically in 
order for `created' and `changed' events to be received.  These can take 
5 seconds or more.

A second issue is that a small delay is needed between the creation of a 
file watch and the beginning of file activity.  This is not normally a 
problem in interactive sessions.  But it can be observed in an 
interactive session by evaluating the following:

(require 'filenotify)
filenotify

(defun my-notify-callback (event)
   (message "Event %S" event))

(progn
   (file-notify-add-watch
    "/tmp/foo" '(change) 'my-notify-callback)
   (write-region "" nil "/tmp/foo"))

(delete-file "/tmp/foo")

;; The above yields `deleted' and `stopped' events, but no `created' 
event.  Now we introduce a delay after adding the watch.

(progn
   (file-notify-add-watch
    "/tmp/foo" '(change) 'my-notify-callback)
   (sleep-for 1)
   (write-region "" nil "/tmp/foo"))

(delete-file "/tmp/foo")

;; This time we get the expected `created' event.

The attached patch takes care of both timing issues.  With this patch, 
all the inexpensive file-notify tests pass on all my Cygwin systems.

Best regards,

Ken


[filenotify-tests.patch (text/plain, attachment)]

This bug report was last modified 8 years and 201 days ago.

Previous Next


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