summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2016-07-14 12:27:41 +0200
committerMichael Albinus <michael.albinus@gmx.de>2016-07-14 12:27:41 +0200
commit8f5a8b69157ed73f14faed6d3dd943d65bce9264 (patch)
tree8984c7d749368550795df9326150b7474a5e9990
parent05ba7a0f83205e647546c2a3bb90e16add58cf06 (diff)
downloademacs-8f5a8b69157ed73f14faed6d3dd943d65bce9264.tar.gz
Improve timing in `tramp-test29-environment-variables'
* test/automated/tramp-tests.el (tramp-test--shell-command-to-string-asynchronously): Add additional `accept-process-output' call. (tramp-test29-environment-variables): Remove additional sleep calls.
-rw-r--r--test/automated/tramp-tests.el22
1 files changed, 9 insertions, 13 deletions
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el
index cc90d1950cd..34d8d6ad495 100644
--- a/test/automated/tramp-tests.el
+++ b/test/automated/tramp-tests.el
@@ -1604,10 +1604,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(async-shell-command command (current-buffer))
;; Suppress nasty messages.
(set-process-sentinel (get-buffer-process (current-buffer)) nil)
- (while
- (and (get-buffer-process (current-buffer))
- (eq (process-status (get-buffer-process (current-buffer))) 'run))
- (accept-process-output (get-buffer-process (current-buffer)) 1))
+ (while (get-buffer-process (current-buffer))
+ (accept-process-output (get-buffer-process (current-buffer)) 0.1))
+ (accept-process-output)
(buffer-substring-no-properties (point-min) (point-max))))
;; This test is inspired by Bug#23952.
@@ -1620,9 +1619,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
'tramp-sh-file-name-handler))
- ;; Implementation note: There is a "sleep 1" at the end of every
- ;; test. Otherwise, the scripts could return too early, without
- ;; expected output.
(dolist (this-shell-command-to-string
'(;; Synchronously.
shell-command-to-string
@@ -1644,7 +1640,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
"foo"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))))
+ (format "echo -n ${%s:?bla}" envvar))))))
(unwind-protect
;; Set the empty value.
@@ -1656,12 +1652,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
"bla"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))
+ (format "echo -n ${%s:?bla}" envvar))))
;; Variable is set.
(should
(string-match
(regexp-quote envvar)
- (funcall this-shell-command-to-string "set; sleep 1")))))
+ (funcall this-shell-command-to-string "set")))))
;; We force a reconnect, in order to have a clean environment.
(tramp-cleanup-connection
@@ -1678,7 +1674,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
"foo"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))
+ (format "echo -n ${%s:?bla}" envvar))))
(let ((process-environment
(cons envvar process-environment)))
;; Variable is unset.
@@ -1687,12 +1683,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
"bla"
(funcall
this-shell-command-to-string
- (format "echo -n ${%s:?bla}; sleep 1" envvar))))
+ (format "echo -n ${%s:?bla}" envvar))))
;; Variable is unset.
(should-not
(string-match
(regexp-quote envvar)
- (funcall this-shell-command-to-string "set; sleep 1")))))))))
+ (funcall this-shell-command-to-string "set")))))))))
(ert-deftest tramp-test30-vc-registered ()
"Check `vc-registered'."