From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25539: 26.0.50; filenotify-tests.el fails on Windows (32 and 64 bits) Date: Fri, 27 Jan 2017 10:31:38 +0200 Message-ID: <83r33o29at.fsf@gnu.org> References: <837f5h3hoj.fsf@gnu.org> <87k29hym2l.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1485506006 13129 195.159.176.226 (27 Jan 2017 08:33:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Jan 2017 08:33:26 +0000 (UTC) Cc: lekktu@gmail.com, 25539@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 27 09:33:17 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX1y0-0001wR-LH for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jan 2017 09:33:08 +0100 Original-Received: from localhost ([::1]:43723 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cX1y4-0002Nx-Hg for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Jan 2017 03:33:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cX1xy-0002Nf-Qs for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 03:33:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cX1xu-0003Ru-Qg for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 03:33:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cX1xu-0003Rq-NT for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 03:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cX1xu-0004gk-6w for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2017 03:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jan 2017 08:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25539 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25539-submit@debbugs.gnu.org id=B25539.148550592217953 (code B ref 25539); Fri, 27 Jan 2017 08:33:02 +0000 Original-Received: (at 25539) by debbugs.gnu.org; 27 Jan 2017 08:32:02 +0000 Original-Received: from localhost ([127.0.0.1]:46935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX1ww-0004fR-Ad for submit@debbugs.gnu.org; Fri, 27 Jan 2017 03:32:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX1wu-0004ez-Er for 25539@debbugs.gnu.org; Fri, 27 Jan 2017 03:32:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cX1wl-00031x-94 for 25539@debbugs.gnu.org; Fri, 27 Jan 2017 03:31:55 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cX1wl-00031r-5q; Fri, 27 Jan 2017 03:31:51 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3981 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cX1wk-0004pB-Da; Fri, 27 Jan 2017 03:31:50 -0500 In-reply-to: <87k29hym2l.fsf@gmx.de> (message from Michael Albinus on Fri, 27 Jan 2017 08:54:42 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:128649 Archived-At: > From: Michael Albinus > Cc: Juanma Barranquero , 25539@debbugs.gnu.org > Date: Fri, 27 Jan 2017 08:54:42 +0100 > > > 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? > > Yes, catching the error somehow in w32notify (don't know how) and fire > up a `stopped' event is preferrable. I let it to you, whether this could > be implemented. I'll leave this bug open, although the test suite now passes. I think I see a way of generating 'stopped', but I'll need to test that (and it will need more changes in filenotify.el and in the tests). > If this is not possible, maybe we shall call > `file-notify--rm-descriptor' in `file-notify-valid-p', when we detect > that the descriptor is not valid anymore, but it still exists. I don't see how this is possible, as file-notify-valid-p doesn't know which descriptors are supposed to be removed. And it will paper over the real problem, so I'd prefer not to do that. > > @@ -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)) > > It would be OK for me also to apply this patch. The test shall be > > (if (string-equal (file-notify--test-library) "w32notify") > > Otherwise, we would catch also the remote case when running the test on > MS Windows. And a respective comment might serve why we apply this. Done, thanks.