]> git.eshelyaron.com Git - emacs.git/commitdiff
Attempt to speed up filenotify-tests
authorMattias Engdegård <mattiase@acm.org>
Mon, 22 May 2023 14:27:00 +0000 (16:27 +0200)
committerMattias Engdegård <mattiase@acm.org>
Mon, 22 May 2023 14:29:22 +0000 (16:29 +0200)
* 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.

test/lisp/filenotify-tests.el

index 97b7c46c6895754a7e76341b01f5126314bbafe0..0873910ddf9f016523d2fdd17e10328fa5944fc7 100644 (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