aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-07-05 17:03:42 +0200
committerMichael Albinus2017-07-05 17:03:42 +0200
commit17efc48000b8cb46c795742b40799ba1bb2019bc (patch)
tree04337ca29bbbd2351b05788e1eb9ffa92c757f70
parent66dd3dc0eae6944630a467d658adacc6e5976f4e (diff)
downloademacs-17efc48000b8cb46c795742b40799ba1bb2019bc.tar.gz
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.el4
-rw-r--r--test/lisp/net/tramp-tests.el45
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."
2128 (unwind-protect 2128 (unwind-protect
2129 (let ((tramp-locker t)) 2129 (let ((tramp-locker t))
2130 (apply foreign operation args)) 2130 (apply foreign operation args))
2131 ;; Give timers a chance. 2131 (setq tramp-locked tl))))))
2132 (unless (setq tramp-locked tl)
2133 (sit-for 0.001 'nodisp)))))))
2134 (cond 2132 (cond
2135 ((eq result 'non-essential) 2133 ((eq result 'non-essential)
2136 (tramp-message 2134 (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."
3739 3739
3740 ;; Open asynchronous processes. Set process filter and sentinel. 3740 ;; Open asynchronous processes. Set process filter and sentinel.
3741 (dolist (buf buffers) 3741 (dolist (buf buffers)
3742 ;; Activate timer.
3743 (sit-for 0.01 'nodisp)
3742 (let ((proc 3744 (let ((proc
3743 (start-file-process-shell-command 3745 (start-file-process-shell-command
3744 (buffer-name buf) buf 3746 (buffer-name buf) buf
@@ -3768,6 +3770,8 @@ process sentinels. They shall not disturb each other."
3768 ;; with regular operation. 3770 ;; with regular operation.
3769 (let ((buffers (copy-sequence buffers))) 3771 (let ((buffers (copy-sequence buffers)))
3770 (while buffers 3772 (while buffers
3773 ;; Activate timer.
3774 (sit-for 0.01 'nodisp)
3771 (let* ((buf (nth (random (length buffers)) buffers)) 3775 (let* ((buf (nth (random (length buffers)) buffers))
3772 (proc (get-buffer-process buf)) 3776 (proc (get-buffer-process buf))
3773 (file (process-get proc 'foo)) 3777 (file (process-get proc 'foo))
@@ -3808,31 +3812,34 @@ process sentinels. They shall not disturb each other."
3808 "Check that Tramp does not fail due to recursive load." 3812 "Check that Tramp does not fail due to recursive load."
3809 (skip-unless (tramp--test-enabled)) 3813 (skip-unless (tramp--test-enabled))
3810 3814
3811 (dolist (code 3815 (let ((default-directory (expand-file-name temporary-file-directory)))
3812 (list 3816 (dolist (code
3813 (format "(expand-file-name %S)" tramp-test-temporary-file-directory) 3817 (list
3814 (format 3818 (format
3815 "(let ((default-directory %S)) (expand-file-name %S))" 3819 "(expand-file-name %S)" tramp-test-temporary-file-directory)
3816 tramp-test-temporary-file-directory 3820 (format
3817 temporary-file-directory))) 3821 "(let ((default-directory %S)) (expand-file-name %S))"
3818 (should-not 3822 tramp-test-temporary-file-directory
3819 (string-match 3823 temporary-file-directory)))
3820 "Recursive load" 3824 (should-not
3821 (shell-command-to-string 3825 (string-match
3822 (format 3826 "Recursive load"
3823 "%s -batch -Q -L %s --eval %s" 3827 (shell-command-to-string
3824 (expand-file-name invocation-name invocation-directory) 3828 (format
3825 (mapconcat 'shell-quote-argument load-path " -L ") 3829 "%s -batch -Q -L %s --eval %s"
3826 (shell-quote-argument code))))))) 3830 (expand-file-name invocation-name invocation-directory)
3831 (mapconcat 'shell-quote-argument load-path " -L ")
3832 (shell-quote-argument code))))))))
3827 3833
3828(ert-deftest tramp-test38-remote-load-path () 3834(ert-deftest tramp-test38-remote-load-path ()
3829 "Check that Tramp autoloads its packages with remote `load-path'." 3835 "Check that Tramp autoloads its packages with remote `load-path'."
3830 ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. 3836 ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el.
3831 ;; It shall still work, when a remote file name is in the 3837 ;; It shall still work, when a remote file name is in the
3832 ;; `load-path'. 3838 ;; `load-path'.
3833 (let ((code 3839 (let ((default-directory (expand-file-name temporary-file-directory))
3834 "(let ((force-load-messages t)\ 3840 (code
3835 (load-path (cons \"/foo:bar:\" load-path)))\ 3841 "(let ((force-load-messages t) \
3842 (load-path (cons \"/foo:bar:\" load-path))) \
3836 (tramp-cleanup-all-connections))")) 3843 (tramp-cleanup-all-connections))"))
3837 (should 3844 (should
3838 (string-match 3845 (string-match