[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 17efc48: Suppress timers in Tramp
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] master 17efc48: Suppress timers in Tramp |
Date: |
Wed, 5 Jul 2017 11:03:49 -0400 (EDT) |
branch: master
commit 17efc48000b8cb46c795742b40799ba1bb2019bc
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
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.
---
lisp/net/tramp.el | 4 +---
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 9c327c4..945f811 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 31cf7f9..6c02daa 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 17efc48: Suppress timers in Tramp,
Michael Albinus <=