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: Thu, 26 Jan 2017 18:33:00 +0200 Message-ID: <837f5h3hoj.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1485448698 14929 195.159.176.226 (26 Jan 2017 16:38:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Jan 2017 16:38:18 +0000 (UTC) Cc: 25539@debbugs.gnu.org To: Juanma Barranquero , Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 26 17:38:13 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 1cWn3k-0002q0-GC for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Jan 2017 17:38:04 +0100 Original-Received: from localhost ([::1]:39734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWn3p-0004Pm-R1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Jan 2017 11:38:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWmzy-0001h4-4V for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2017 11:34:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWmzq-0000zD-1x for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2017 11:34:10 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47573) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cWmzp-0000z2-Vo for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2017 11:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cWmzp-0001Qs-QZ for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2017 11:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Jan 2017 16:34:01 +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.14854484105461 (code B ref 25539); Thu, 26 Jan 2017 16:34:01 +0000 Original-Received: (at 25539) by debbugs.gnu.org; 26 Jan 2017 16:33:30 +0000 Original-Received: from localhost ([127.0.0.1]:45772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWmzK-0001Q1-AC for submit@debbugs.gnu.org; Thu, 26 Jan 2017 11:33:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWmzI-0001Pp-Qb for 25539@debbugs.gnu.org; Thu, 26 Jan 2017 11:33:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWmz8-0000pV-Qy for 25539@debbugs.gnu.org; Thu, 26 Jan 2017 11:33:23 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWmz8-0000pR-Ms; Thu, 26 Jan 2017 11:33:18 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3613 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cWmz7-0007zm-Es; Thu, 26 Jan 2017 11:33:18 -0500 In-reply-to: (message from Juanma Barranquero on Thu, 26 Jan 2017 01:03:09 +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:128565 Archived-At: > From: Juanma Barranquero > 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))