From: Mattias EngdegÄrd Date: Mon, 22 May 2023 14:27:00 +0000 (+0200) Subject: Attempt to speed up filenotify-tests X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0cb1d695b429fceb45a11cd7ed73f3bb9ce7002f;p=emacs.git Attempt to speed up filenotify-tests * test/lisp/filenotify-tests.el (file-notify-test04-autorevert): Run with a lower `auto-revert-interval` (1 s) and adjust the a timeout value. This should lower the time for this particular test from 25 to below 10 s. --- diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 97b7c46c689..0873910ddf9 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -939,10 +939,13 @@ delivered." :tags '(:expensive-test) (skip-unless (file-notify--test-local-enabled)) - ;; `auto-revert-buffers' runs every 5". And we must wait, until the - ;; file has been reverted. - (let ((timeout (if (file-remote-p temporary-file-directory) 60 10)) - buf) + ;; Run with shortened `auto-revert-interval' for a faster test. + (let* ((auto-revert-interval 1) + (timeout (if (file-remote-p temporary-file-directory) + 60 ; FIXME: can this be shortened? + (* auto-revert-interval 2.5))) + buf) + (auto-revert-set-timer) (unwind-protect (progn ;; In the remote case, `vc-refresh-state' returns undesired @@ -960,10 +963,9 @@ delivered." (sleep-for 1) (auto-revert-mode 1) - ;; `auto-revert-buffers' runs every 5". (with-timeout (timeout (ignore)) (while (null auto-revert-notify-watch-descriptor) - (sleep-for 1))) + (sleep-for 0.2))) ;; `file-notify--test-monitor' needs to know ;; `file-notify--test-desc' in order to compute proper