diff options
| author | Mattias EngdegÄrd | 2023-05-22 16:27:00 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2023-05-22 16:29:22 +0200 |
| commit | 0cb1d695b429fceb45a11cd7ed73f3bb9ce7002f (patch) | |
| tree | c46f6111dddbf9261f1f3e6fe5221669fcb39a6a | |
| parent | abb11eb3a3c1a8a29a43c584bcaa8917db52a541 (diff) | |
| download | emacs-0cb1d695b429fceb45a11cd7ed73f3bb9ce7002f.tar.gz emacs-0cb1d695b429fceb45a11cd7ed73f3bb9ce7002f.zip | |
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.
| -rw-r--r-- | test/lisp/filenotify-tests.el | 14 |
1 files changed, 8 insertions, 6 deletions
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." | |||
| 939 | :tags '(:expensive-test) | 939 | :tags '(:expensive-test) |
| 940 | (skip-unless (file-notify--test-local-enabled)) | 940 | (skip-unless (file-notify--test-local-enabled)) |
| 941 | 941 | ||
| 942 | ;; `auto-revert-buffers' runs every 5". And we must wait, until the | 942 | ;; Run with shortened `auto-revert-interval' for a faster test. |
| 943 | ;; file has been reverted. | 943 | (let* ((auto-revert-interval 1) |
| 944 | (let ((timeout (if (file-remote-p temporary-file-directory) 60 10)) | 944 | (timeout (if (file-remote-p temporary-file-directory) |
| 945 | buf) | 945 | 60 ; FIXME: can this be shortened? |
| 946 | (* auto-revert-interval 2.5))) | ||
| 947 | buf) | ||
| 948 | (auto-revert-set-timer) | ||
| 946 | (unwind-protect | 949 | (unwind-protect |
| 947 | (progn | 950 | (progn |
| 948 | ;; In the remote case, `vc-refresh-state' returns undesired | 951 | ;; In the remote case, `vc-refresh-state' returns undesired |
| @@ -960,10 +963,9 @@ delivered." | |||
| 960 | (sleep-for 1) | 963 | (sleep-for 1) |
| 961 | (auto-revert-mode 1) | 964 | (auto-revert-mode 1) |
| 962 | 965 | ||
| 963 | ;; `auto-revert-buffers' runs every 5". | ||
| 964 | (with-timeout (timeout (ignore)) | 966 | (with-timeout (timeout (ignore)) |
| 965 | (while (null auto-revert-notify-watch-descriptor) | 967 | (while (null auto-revert-notify-watch-descriptor) |
| 966 | (sleep-for 1))) | 968 | (sleep-for 0.2))) |
| 967 | 969 | ||
| 968 | ;; `file-notify--test-monitor' needs to know | 970 | ;; `file-notify--test-monitor' needs to know |
| 969 | ;; `file-notify--test-desc' in order to compute proper | 971 | ;; `file-notify--test-desc' in order to compute proper |