From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#35418: [PATCH] Don't poll auto-revert files that use notification Date: Sun, 19 May 2019 11:12:31 +0200 Message-ID: <87woimdczk.fsf@gmx.de> References: <87woj9nj77.fsf@gmx.de> <83r29fmz3f.fsf@gnu.org> <6b722334f6eaddcbbf3def636b5181c9439a172c.camel@acm.org> <831s1emvz7.fsf@gnu.org> <26e8159ac86da37d9cf555f6cb3f2dcb63ac0a67.camel@acm.org> <87y33mgo0c.fsf@gmx.de> <05128E42-E970-4C41-9DF9-E9E0BC1C9E4A@acm.org> <87tveagg4f.fsf@gmx.de> <87pnoygdx6.fsf@gmx.de> <8FEB518A-F5AA-488B-BDC5-7947FFE51394@acm.org> <87lfzlgvka.fsf@gmx.de> <3D200C55-AD11-4214-9C50-C2183F6598CC@acm.org> <93015872-0F5F-4E27-97BB-94BA0EE72653@acm.org> <87muju1vx1.fsf@gmx.de> <25E4EBE0-0E65-45B7-B56F-9C67A2862DFA@acm.org> <87a7fu1nv8.fsf@gmx.de> <87tvdyie82.fsf@gmx.de> <4FD5C2DB-8F3D-4317-B8ED-CB7A4605A2F1@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="141853"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35418@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 19 11:13:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSHsd-000agp-5P for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 May 2019 11:13:19 +0200 Original-Received: from localhost ([127.0.0.1]:45944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSHsW-0005AG-MM for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 May 2019 05:13:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSHsQ-000589-92 for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 05:13:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSHsM-000643-Kv for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 05:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48453) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSHsM-00063v-GX for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 05:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hSHsM-0001lR-7j for bug-gnu-emacs@gnu.org; Sun, 19 May 2019 05:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2019 09:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35418-submit@debbugs.gnu.org id=B35418.15582571706763 (code B ref 35418); Sun, 19 May 2019 09:13:02 +0000 Original-Received: (at 35418) by debbugs.gnu.org; 19 May 2019 09:12:50 +0000 Original-Received: from localhost ([127.0.0.1]:33764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSHs9-0001l1-RL for submit@debbugs.gnu.org; Sun, 19 May 2019 05:12:50 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:40207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSHs7-0001kn-BZ for 35418@debbugs.gnu.org; Sun, 19 May 2019 05:12:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1558257154; bh=Tf70ZXRRjvAgJ2WVs2Zb44pGaLCHO9tJNH2i3S4d9bI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=konC0LIA9eQi7WSs0VNRM5i1vvqHu6a5AZ1o+K9925Imk27m9O8v7XBSmOlk9SCXf R+G6C3gg9OdkfoOjf0xEEDUP3qUpHzlAhJqnX14T75cJW0V32J8gvcO9v5PTq/Yor9 aeNqhfgRiUIWxqBcFoj0uqP3N6SU86mDBlTu9ll8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([212.86.60.145]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mchyv-1hAU2F06oD-00Hx4b; Sun, 19 May 2019 11:12:34 +0200 In-Reply-To: <4FD5C2DB-8F3D-4317-B8ED-CB7A4605A2F1@acm.org> ("Mattias \=\?utf-8\?Q\?Engdeg\=C3\=A5rd\=22's\?\= message of "Sat, 18 May 2019 19:39:01 +0200") X-Provags-ID: V03:K1:Y4qM9GO0ePIF2rKqueb1jqMqAeFwlzwJ4Qb6quEYtMdL+LXHoyH 5AsqHgK8T5pqZJRopPJYrfGM1VAbsPLgILAspfFt7adS076Zqu/3pMjC5kL1lVVNIR8SQjG OdMv8s2Z80Zzyk1NnP41QqpSd5ggojmqKXH1AEyRbLFME9DK9U4u96uHa10IRGgn196vgk/ FR2KHDevpEctW5VGxeQag== X-UI-Out-Filterresults: notjunk:1;V03:K0:jEOas4qzFGE=:ttXLx1cxf5OX5L1+hEBcO9 +V0xTyy16LEu4GOrd2kMVUbCM4cdjuMqsH5WdGfzWrCUMWRoIlU6cWdf7AUB6IZwpr9zixldI lEdxgG3PXqXE48AAyUZZGeiNwwftLHFbPakT278EZI5Iohl8QL4paQ6jZ+nzSaPLDqW+ccxHh OhGuGPiS8CKuL0D7+8sVRb2JsUP3ZrX6odZdpgTSAMoDLqz3lapk/HLSppiFq3iwajYWJHSCn KCRVhdgM1ivxQmSFZBwW9JwZjZ1SAYF9FOrEbUxR1hZOLQyvfHwIu810nrYe1Irh4V3JnS/dH j95Rzzh8un19+v1rCjGWc2RM+fzaXpxds71Z7xkCICKf4zSZg9g5+mjfH/mytoSKM8a7ydOto H1akJPtRUEm/GaEuQm4C9WUUXAzdkhBCCKSqI69ewXm84Nu89sFzF+bhCSM9GxXYQIgmTKqB5 fQKGHRzrEeilQ0CSd7/Qs8/ujG51ijQKo9F4rn0gnbtZQkIVS3pbT14371qoeA8qEmXYHP8dp du8fUxn3BZ7MQlcyXRJOYEk6r+hm/D4zG+DbqGtT4qrq9SgvXFSZlbq1yTbxpVnEkSlQdd9Ge Eq957o0rjbKsek1fNo4PASYT26SSXI5DzfH1xEIWkGShbiqt+RFN6nLbI7taAWte5sRycsiBQ H9XwHR/tfmpVmwIvE96aSJIZnNf2GOagfIe2p0Hkh2Yc/Xr0eOFZ9J9Kz6AQKJCuwu8jQrocj C8C60rXXtdGoDrtZxMU9HSQcUIgcGNXBocH4+NCJuriU8pKm+JTdes29wUoGPFc4yo5S1xyZ 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: 209.51.188.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:159528 Archived-At: Mattias Engdeg=C3=A5rd writes: Hi Mattias, > Thank you -- I added one, but have only access to kqueue at the moment > so I haven't run it on anything else. Thanks. I've applied it also for inotify, gfile, inotifywait and gio-monitor. All tests passed, at least the local ones. auto-revert-test05-global-notify-remote (see below) failed; this one I could debug myself once the patch has landed in master. I suspect timing issues. Btw, you could always run the four tests on emba.gnu.org. Submit a change (also a git branch would do), and the bot on emba.git.org would run these test constellations for you. Same for filenotify-tests. Comments: > --- a/lisp/autorevert.el > +++ b/lisp/autorevert.el > "Check if auto-revert is active (in current buffer or globally)." Remove "or globally". > --- a/test/lisp/autorevert-tests.el > +++ b/test/lisp/autorevert-tests.el > +(defun auto-revert-test--write-file (string file) > + (write-region string nil file nil 'no-message)) > + > +(defun auto-revert-test--buffer-string (buffer) > + (with-current-buffer buffer > + (buffer-string))) Pls add a docstring. > +(ert-deftest auto-revert-test05-global-notify () > + "Test global-auto-revert-mode without polling." Quote `global-auto-revert-mode'. Check also, whether file notification is enabled: (skip-unless (or file-notify--library (file-remote-p temporary-file-directory))) > + (let* ((auto-revert-avoid-polling t) Enable file notification explicitly. You don't know, whether the user has disabled it. (let* ((auto-revert-use-notify t) (auto-revert-avoid-polling t) > + (auto-revert-interval 2) ; To speed up the test. Do we really want this? I prefer to test the unmodified package. If you believe this takes too much time for ordinary "make check" calls, you might tag the test case as :expensive-test, like auto-revert-test01-auto-revert-several-files and auto-revert-test02-auto-revert-deleted-file. > + (global-auto-revert-mode 1) ; Turn it on. Save the value of global-auto-revert-mode, and reset it in Cleanup. You don't know the user's settings. > + (dolist (buf (list buf-1 buf-2 buf-3)) > + (when (buffer-live-p buf) > + (kill-buffer buf))) Why not (ignore-errors (kill-buffer buf)) ? Add the remote test case: (auto-revert--deftest-remote auto-revert-test05-global-notify "Test `global-auto-revert-mode' without polling for remote buffers." Best regards, Michael.