From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabrice Popineau Newsgroups: gmane.emacs.bugs Subject: bug#22534: File notify broken on Windows Date: Sun, 7 Feb 2016 20:34:10 +0100 Message-ID: References: <83h9hrytom.fsf@gnu.org> <87lh72xln0.fsf@gmx.de> <838u30wbx5.fsf@gnu.org> <83fux7v56c.fsf@gnu.org> <871t8rm5x8.fsf@gmx.de> <83si17t02p.fsf@gnu.org> <83wpqhsrv3.fsf@gnu.org> <874mdllk0f.fsf@gmx.de> <83r3gpsjey.fsf@gnu.org> <83a8ncs9b4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c30ba04c401e052b332c02 X-Trace: ger.gmane.org 1454873723 7237 80.91.229.3 (7 Feb 2016 19:35:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Feb 2016 19:35:23 +0000 (UTC) Cc: 22534@debbugs.gnu.org, Michael Albinus To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 07 20:35:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aSV72-00060L-4O for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 20:35:12 +0100 Original-Received: from localhost ([::1]:37526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSV71-0004dT-Fl for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 14:35:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSV6v-0004aY-Bh for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 14:35:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSV6s-0002KO-1d for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 14:35:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSV6r-0002KK-V1 for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 14:35:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSV6r-0006Gs-JY for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 14:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Fabrice Popineau Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Feb 2016 19:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22534 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22534-submit@debbugs.gnu.org id=B22534.145487367824054 (code B ref 22534); Sun, 07 Feb 2016 19:35:01 +0000 Original-Received: (at 22534) by debbugs.gnu.org; 7 Feb 2016 19:34:38 +0000 Original-Received: from localhost ([127.0.0.1]:37495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSV6T-0006Fo-Ms for submit@debbugs.gnu.org; Sun, 07 Feb 2016 14:34:38 -0500 Original-Received: from mail-ob0-f179.google.com ([209.85.214.179]:32943) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSV6R-0006FX-IT for 22534@debbugs.gnu.org; Sun, 07 Feb 2016 14:34:36 -0500 Original-Received: by mail-ob0-f179.google.com with SMTP id is5so128866930obc.0 for <22534@debbugs.gnu.org>; Sun, 07 Feb 2016 11:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=y+Wit54yTabQU2NOxXO/pFu26F4FczlAyau+BQgZIPs=; b=yAPerKnuX2Etbc55sOIqiBsaWPkXIJlf6a8+qHHFCXS8h/PWKTyYx0GbQjC5CkiREv BG9jUb6NCjY1uEblxKAcErPV9XOLq5ADlLNU0nilzXpJmDZ2xY7akkD0Lic4h+M68yDq NxTZEwxcJGQTTWo+hdXW6BI0Rg/8ZPmM3AGtxgYuCsm199mwrhnLlWComL9QtC1jU2qf j58H0iKDUMUL8QNBOIqxJlFxkZMWS95sKscmCw4/9ljOnRHDBP5IvSXMpchHriZgVGMp e2sPJZ7NeYyoG9p3vrv2gke97+DXLJGxfcC61/PpHTYcqw5qELIjkvfI2NQv3/xi0foC ALrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=y+Wit54yTabQU2NOxXO/pFu26F4FczlAyau+BQgZIPs=; b=Bss2be+uuHGAFv4IkF8XZVQUKWHlkEagvKMwf1DqKFlEgR6jGiWkIXpFzDBSBmd0gA zcIgzUnM9g7g0ljMuJzh2KX+7G7O69l4cqLRFFI2dzR81ucHl8F3tzVIQ88h6I3U/k24 KZJzEyYpd4L5IE3BPIykuLXPATFuNtvxRLk1eYpbA6mO46pXswImidyuipRrgAyN2F6P eWGJHARHEDYPAx+CXQFBb9YfF2xEWJBtevsyZ/wnsElGqufOIiHW++4bgI7PZmjdgBbO BVrxzwviQ+AmgiPHvy/t//EpiMDHAaTjWLVjm0SSrBqvzQE1egC4mGCaO5KbSb+6GUL0 +uQQ== X-Gm-Message-State: AG10YOSLBnNX7Dc4lc9YLMDNduTDBVh3mJN9Lxg0jW+2zhmhy/U0Sx/HHqr72FJxP3mfQYyZ8nqtahtuHVjP/w== X-Received: by 10.60.67.71 with SMTP id l7mr13994786oet.55.1454873670072; Sun, 07 Feb 2016 11:34:30 -0800 (PST) Original-Received: by 10.202.78.75 with HTTP; Sun, 7 Feb 2016 11:34:10 -0800 (PST) In-Reply-To: <83a8ncs9b4.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112649 Archived-At: --001a11c30ba04c401e052b332c02 Content-Type: text/plain; charset=UTF-8 2016-02-07 18:46 GMT+01:00 Eli Zaretskii : > > From: Fabrice Popineau > > Date: Sun, 7 Feb 2016 14:37:34 +0100 > > Cc: Michael Albinus , 22534@debbugs.gnu.org > > > > In the 'check for attribute change', I see only 2 'changed' > notifications, and not 4 > > as expected by the test (around line 512: w32notify does not distinguish > between > > 'changed' and 'attribute-changed'). > > > > So I need to apply : > > > > diff --git a/test/automated/file-notify-tests.el > b/test/automated/file-notify-tests.el > > index 5fc4ff8..943bd7e 100644 > > --- a/test/automated/file-notify-tests.el > > +++ b/test/automated/file-notify-tests.el > > @@ -507,7 +512,7 @@ file-notify--test-with-events > > ;; w32notify does not distinguish between `changed' and > > ;; `attribute-changed'. > > ((string-equal (file-notify--test-library) "w32notify") > > - '(changed changed changed changed)) > > + '(changed changed)) > > ;; For kqueue and in the remote case, `write-region' > > ;; raises also an `attribute-changed' event. > > ((or (string-equal (file-notify--test-library) "kqueue") > > Can you instrument filenotify.el to show the w32notify events this > test generates, complete with the corresponding file names? I will > then compare to what I see here. > > I printed the expected notifications and the ones that occur: Library: `w32notify' passed 1/6 file-notify-test00-availability passed 2/6 file-notify-test01-add-watch events: ((created changed deleted stopped)) ((17923488 created c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748mQW) (17923488 changed c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748mQW) (17923488 deleted c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748mQW) (17923488 stopped c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748mQW)) events: ((changed changed deleted stopped)) ((17490424 changed c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748zac) (17490424 changed c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748zac) (17490424 deleted c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748zac) (17490424 stopped c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748zac)) events: ((created changed deleted)) ((17491048 created c:/Users/Fabrice/AppData/Local/Temp/file-notify-test-parent20748Ali/file-notify-test20748Nvo) (17491048 changed c:/Users/Fabrice/AppData/Local/Temp/file-notify-test-parent20748Ali/file-notify-test20748Nvo)) Test file-notify-test02-events backtrace: #[0 "\306\307\310C\307C\3111(\312\313\314\315$\317\"\32 ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc ert-run-test([cl-struct-ert-test file-notify-test02-events "Check fi ert-run-or-rerun-test([cl-struct-ert--stats (not (tag :expensive-tes ert-run-tests((not (tag :expensive-test)) #[385 "\306\307\"\203G\2 ert-run-tests-batch((not (tag :expensive-test))) ert-run-tests-batch-and-exit((not (tag :expensive-test))) eval((ert-run-tests-batch-and-exit (quote (not (tag :expensive-test) command-line-1(("-L" ";../../../emacs/test/automated" "-l" "ert" "-l command-line() normal-top-level() Test file-notify-test02-events condition: (ert-test-failed ((should (dolist (elt events result) (setq result ...))) :form (let ((--dolist-tail-- events)) (while --dolist-tail-- (let ... ... ...)) result) :value nil)) FAILED 3/6 file-notify-test02-events Reverting buffer `file-notify-test20748a5u'. passed 4/6 file-notify-test03-autorevert events: ((changed changed deleted stopped)) ((19211556 changed c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE) (19211556 changed c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE) (19211556 deleted c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE) (19211556 stopped c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE)) passed 5/6 file-notify-test04-file-validity passed 6/6 file-notify-test05-dir-validity > > For the rest of this test, whereas the test passes in interactive mode, > it fails in batch mode with > > several 'deleted' notifications. Namely, I need to apply the following > for the test to pass. > > Does it help to add a call to > > (read-event nil nil 0.1) > > after the code that invokes the deletion in each of these cases? > I have added this wait time after each delete-directory call in file-notify-test02-events with no difference. I must add that the same test works interactively. It is only in batch mode that I don't see the deleted notifications. Fabrice --001a11c30ba04c401e052b332c02 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2016-02-07 18:46 GMT+01:00 Eli Zaretskii <eliz@gnu.org>:
=
> From: Fabrice Popineau <fabrice.popineau@gmail.com>
> Date: Sun, 7 Feb 2016 14:37:34 +0100
> Cc: Michael Albinus <michael.albinus@gmx.de>, 22534@debbugs.gnu.org
>
> In the 'check for attribute change', I= see only 2 'changed' notifications, and not 4
> as expected by the test (around line 512: w32notify does not distingui= sh between
> 'changed' and 'attribute-changed').
>
> So I need to apply :
>
> diff --git a/test/automated/file-notify-tests.el b/test/automated/file= -notify-tests.el
> index 5fc4ff8..943bd7e 100644
> --- a/test/automated/file-notify-tests.el
> +++ b/test/automated/file-notify-tests.el
> @@ -507,7 +512,7 @@ file-notify--test-with-events
> ;; w32notify does not distinguish between `changed' and
> ;; `attribute-changed'.
> ((string-equal (file-notify--test-library) "w32notify")
> - '(changed changed changed changed))
> + '(changed changed))
> ;; For kqueue and in the remote case, `write-region'
> ;; raises also an `attribute-changed' event.
> ((or (string-equal (file-notify--test-library) "kqueue")

Can you instrument filenotify.el to show the w32notify events this test generates, complete with the corresponding file names?=C2=A0 I will then compare to what I see here.


I printed the = expected notifications and the ones that occur:

Li= brary: `w32notify'
=C2=A0 =C2=A0passed =C2=A01/6 =C2=A0file-n= otify-test00-availability
=C2=A0 =C2=A0passed =C2=A02/6 =C2=A0fil= e-notify-test01-add-watch
events: ((created changed deleted stopp= ed)) ((17923488 created c:/Users/Fabrice/AppData/Local/Temp/file-notify-tes= t20748mQW) (17923488 changed c:/Users/Fabrice/AppData/Local/Temp/file-notif= y-test20748mQW) (17923488 deleted c:/Users/Fabrice/AppData/Local/Temp/file-= notify-test20748mQW) (17923488 stopped c:/Users/Fabrice/AppData/Local/Temp/= file-notify-test20748mQW))
events: ((changed changed deleted stop= ped)) ((17490424 changed c:/Users/Fabrice/AppData/Local/Temp/file-notify-te= st20748zac) (17490424 changed c:/Users/Fabrice/AppData/Local/Temp/file-noti= fy-test20748zac) (17490424 deleted c:/Users/Fabrice/AppData/Local/Temp/file= -notify-test20748zac) (17490424 stopped c:/Users/Fabrice/AppData/Local/Temp= /file-notify-test20748zac))
events: ((created changed deleted)) (= (17491048 created c:/Users/Fabrice/AppData/Local/Temp/file-notify-test-pare= nt20748Ali/file-notify-test20748Nvo) (17491048 changed c:/Users/Fabrice/App= Data/Local/Temp/file-notify-test-parent20748Ali/file-notify-test20748Nvo))<= /div>
Test file-notify-test02-events backtrace:
=C2=A0 #[0 &q= uot;\306\307\310C\307C\3111(\312\313\314\315$\317\"\32
=C2= =A0 ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
=C2=A0 ert-run-test([cl-struct-ert-test file-notify-test02-events &= quot;Check fi
=C2=A0 ert-run-or-rerun-test([cl-struct-ert--stats = (not (tag :expensive-tes
=C2=A0 ert-run-tests((not (tag :expensiv= e-test)) #[385 "\306\307\"\203G\2
=C2=A0 ert-run-tests-= batch((not (tag :expensive-test)))
=C2=A0 ert-run-tests-batch-and= -exit((not (tag :expensive-test)))
=C2=A0 eval((ert-run-tests-bat= ch-and-exit (quote (not (tag :expensive-test)
=C2=A0 command-line= -1(("-L" ";../../../emacs/test/automated" "-l"= ; "ert" "-l
=C2=A0 command-line()
=C2=A0= normal-top-level()
Test file-notify-test02-events condition:
=C2=A0 =C2=A0 (ert-test-failed
=C2=A0 =C2=A0 =C2=A0((shoul= d
=C2=A0 =C2=A0 =C2=A0 =C2=A0(dolist
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(elt events result)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(setq result ...)))
=C2=A0 =C2=A0 =C2=A0 :form
=
=C2=A0 =C2=A0 =C2=A0 (let
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= ((--dolist-tail-- events))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (while --= dolist-tail--
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ... ... ...= ))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 result)
=C2=A0 =C2=A0 = =C2=A0 :value nil))
=C2=A0 =C2=A0FAILED =C2=A03/6 =C2=A0file-noti= fy-test02-events
Reverting buffer `file-notify-test20748a5u'.=
=C2=A0 =C2=A0passed =C2=A04/6 =C2=A0file-notify-test03-autorever= t
events: ((changed changed deleted stopped)) ((19211556 changed = c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE) (19211556 cha= nged c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE) (1921155= 6 deleted c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE) (19= 211556 stopped c:/Users/Fabrice/AppData/Local/Temp/file-notify-test20748ZNE= ))
=C2=A0 =C2=A0passed =C2=A05/6 =C2=A0file-notify-test04-file-va= lidity
=C2=A0 =C2=A0passed =C2=A06/6 =C2=A0file-notify-test05-dir= -validity
=C2=A0
> For the rest of this test, whereas the test passes in interactive mode= , it fails in batch mode with
> several 'deleted' notifications. Namely, I need to apply the f= ollowing for the test to pass.

Does it help to add a call to

=C2=A0 (read-event nil nil 0.1)

after the code that invokes the deletion in each of these cases?

I have added this w= ait time after each delete-directory call in file-notify-test02-events
with no difference.

I must add that the same test wor= ks interactively.=C2=A0
It is only in batch= mode that I don't see the deleted notifications.


Fabrice


--001a11c30ba04c401e052b332c02--