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.
This commit is contained in:
Mattias Engdegård 2023-05-22 16:27:00 +02:00
parent abb11eb3a3
commit 0cb1d695b4

View file

@ -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