diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2017-07-05 17:03:42 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2017-07-05 17:03:42 +0200 |
commit | 17efc48000b8cb46c795742b40799ba1bb2019bc (patch) | |
tree | 04337ca29bbbd2351b05788e1eb9ffa92c757f70 | |
parent | 66dd3dc0eae6944630a467d658adacc6e5976f4e (diff) | |
download | emacs-17efc48000b8cb46c795742b40799ba1bb2019bc.tar.gz emacs-17efc48000b8cb46c795742b40799ba1bb2019bc.tar.bz2 emacs-17efc48000b8cb46c795742b40799ba1bb2019bc.zip |
Suppress timers in Tramp
* lisp/net/tramp.el (tramp-file-name-handler): Don't trigger timers.
* test/lisp/net/tramp-tests.el
(tramp-test36-asynchronous-requests): Trigger timers.
(tramp-test37-recursive-load, tramp-test38-remote-load-path):
Set `default-directory' to a trustworthy value.
-rw-r--r-- | lisp/net/tramp.el | 4 | ||||
-rw-r--r-- | test/lisp/net/tramp-tests.el | 45 |
2 files changed, 27 insertions, 22 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9c327c410a7..945f81188c8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2128,9 +2128,7 @@ Falls back to normal file name handler if no Tramp file name handler exists." (unwind-protect (let ((tramp-locker t)) (apply foreign operation args)) - ;; Give timers a chance. - (unless (setq tramp-locked tl) - (sit-for 0.001 'nodisp))))))) + (setq tramp-locked tl)))))) (cond ((eq result 'non-essential) (tramp-message diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 31cf7f9ba1c..6c02daa6547 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3739,6 +3739,8 @@ process sentinels. They shall not disturb each other." ;; Open asynchronous processes. Set process filter and sentinel. (dolist (buf buffers) + ;; Activate timer. + (sit-for 0.01 'nodisp) (let ((proc (start-file-process-shell-command (buffer-name buf) buf @@ -3768,6 +3770,8 @@ process sentinels. They shall not disturb each other." ;; with regular operation. (let ((buffers (copy-sequence buffers))) (while buffers + ;; Activate timer. + (sit-for 0.01 'nodisp) (let* ((buf (nth (random (length buffers)) buffers)) (proc (get-buffer-process buf)) (file (process-get proc 'foo)) @@ -3808,31 +3812,34 @@ process sentinels. They shall not disturb each other." "Check that Tramp does not fail due to recursive load." (skip-unless (tramp--test-enabled)) - (dolist (code - (list - (format "(expand-file-name %S)" tramp-test-temporary-file-directory) - (format - "(let ((default-directory %S)) (expand-file-name %S))" - tramp-test-temporary-file-directory - temporary-file-directory))) - (should-not - (string-match - "Recursive load" - (shell-command-to-string - (format - "%s -batch -Q -L %s --eval %s" - (expand-file-name invocation-name invocation-directory) - (mapconcat 'shell-quote-argument load-path " -L ") - (shell-quote-argument code))))))) + (let ((default-directory (expand-file-name temporary-file-directory))) + (dolist (code + (list + (format + "(expand-file-name %S)" tramp-test-temporary-file-directory) + (format + "(let ((default-directory %S)) (expand-file-name %S))" + tramp-test-temporary-file-directory + temporary-file-directory))) + (should-not + (string-match + "Recursive load" + (shell-command-to-string + (format + "%s -batch -Q -L %s --eval %s" + (expand-file-name invocation-name invocation-directory) + (mapconcat 'shell-quote-argument load-path " -L ") + (shell-quote-argument code)))))))) (ert-deftest tramp-test38-remote-load-path () "Check that Tramp autoloads its packages with remote `load-path'." ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. ;; It shall still work, when a remote file name is in the ;; `load-path'. - (let ((code - "(let ((force-load-messages t)\ - (load-path (cons \"/foo:bar:\" load-path)))\ + (let ((default-directory (expand-file-name temporary-file-directory)) + (code + "(let ((force-load-messages t) \ + (load-path (cons \"/foo:bar:\" load-path))) \ (tramp-cleanup-all-connections))")) (should (string-match |