aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-07-02 10:06:09 +0200
committerMichael Albinus2017-07-02 10:06:09 +0200
commit3269a585c4e6772af0d0e32729cfebf2662a5ba6 (patch)
tree8b8172c1bbae4ce04740069e5804f7c4876197af
parent9a2a7bb6e6e08c2107a94c9a2e90e316a6f91d48 (diff)
downloademacs-3269a585c4e6772af0d0e32729cfebf2662a5ba6.tar.gz
emacs-3269a585c4e6772af0d0e32729cfebf2662a5ba6.zip
; Instrument tramp-tests.el
-rw-r--r--test/lisp/net/tramp-tests.el19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index a706ed5fb90..10d52f31607 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3689,6 +3689,9 @@ process sentinels. They shall not disturb each other."
3689 (skip-unless (tramp--test-enabled)) 3689 (skip-unless (tramp--test-enabled))
3690 (skip-unless (tramp--test-sh-p)) 3690 (skip-unless (tramp--test-sh-p))
3691 3691
3692 ;; This test times out on hydra.
3693 (with-timeout
3694 (300 (ert-fail "`tramp-test36-asynchronous-requests' timed out"))
3692 (let* ((tmp-name (tramp--test-make-temp-name)) 3695 (let* ((tmp-name (tramp--test-make-temp-name))
3693 (default-directory tmp-name) 3696 (default-directory tmp-name)
3694 ;; Do not cache Tramp properties. 3697 ;; Do not cache Tramp properties.
@@ -3719,9 +3722,13 @@ process sentinels. They shall not disturb each other."
3719 0 timer-repeat 3722 0 timer-repeat
3720 (lambda () 3723 (lambda ()
3721 (when buffers 3724 (when buffers
3722 (let ((file 3725 (let ((default-directory tmp-name)
3726 (file
3723 (buffer-name (nth (random (length buffers)) buffers)))) 3727 (buffer-name (nth (random (length buffers)) buffers))))
3724 (funcall timer-operation file)))))) 3728 (tramp--test-message "Start timer %s %s" timer-operation file)
3729 (funcall timer-operation file)
3730 (tramp--test-message
3731 "Stop timer %s %s" timer-operation file))))))
3725 3732
3726 ;; Create temporary buffers. The number of buffers 3733 ;; Create temporary buffers. The number of buffers
3727 ;; corresponds to the number of processes; it could be 3734 ;; corresponds to the number of processes; it could be
@@ -3731,6 +3738,7 @@ process sentinels. They shall not disturb each other."
3731 3738
3732 ;; Open asynchronous processes. Set process sentinel. 3739 ;; Open asynchronous processes. Set process sentinel.
3733 (dolist (buf buffers) 3740 (dolist (buf buffers)
3741 (tramp--test-message "Start process %s" buf)
3734 (let ((proc 3742 (let ((proc
3735 (start-file-process-shell-command 3743 (start-file-process-shell-command
3736 (buffer-name buf) buf 3744 (buffer-name buf) buf
@@ -3746,6 +3754,7 @@ process sentinels. They shall not disturb each other."
3746 (set-process-filter 3754 (set-process-filter
3747 proc 3755 proc
3748 (lambda (proc string) 3756 (lambda (proc string)
3757 (tramp--test-message "Process filter %s" proc)
3749 (with-current-buffer (process-buffer proc) 3758 (with-current-buffer (process-buffer proc)
3750 (insert string)) 3759 (insert string))
3751 (unless (zerop (length string)) 3760 (unless (zerop (length string))
@@ -3754,6 +3763,7 @@ process sentinels. They shall not disturb each other."
3754 (set-process-sentinel 3763 (set-process-sentinel
3755 proc 3764 proc
3756 (lambda (proc _state) 3765 (lambda (proc _state)
3766 (tramp--test-message "Process sentinel %s" proc)
3757 (should-not (file-attributes (process-get proc 'foo))))))) 3767 (should-not (file-attributes (process-get proc 'foo)))))))
3758 3768
3759 ;; Send a string. Use a random order of the buffers. Mix 3769 ;; Send a string. Use a random order of the buffers. Mix
@@ -3769,6 +3779,7 @@ process sentinels. They shall not disturb each other."
3769 (should-not (file-attributes file)) 3779 (should-not (file-attributes file))
3770 (should (file-attributes file))) 3780 (should (file-attributes file)))
3771 ;; Send string to process. 3781 ;; Send string to process.
3782 (tramp--test-message "Send string %s" proc)
3772 (process-send-string proc (format "%s\n" (buffer-name buf))) 3783 (process-send-string proc (format "%s\n" (buffer-name buf)))
3773 (accept-process-output proc 0.1 nil 0) 3784 (accept-process-output proc 0.1 nil 0)
3774 ;; Regular operation. 3785 ;; Regular operation.
@@ -3777,10 +3788,12 @@ process sentinels. They shall not disturb each other."
3777 (should (file-attributes file))) 3788 (should (file-attributes file)))
3778 (process-put proc 'bar (1+ count)) 3789 (process-put proc 'bar (1+ count))
3779 (unless (process-live-p proc) 3790 (unless (process-live-p proc)
3791 (tramp--test-message "Buffer delete %s" buf)
3780 (setq buffers (delq buf buffers)))))) 3792 (setq buffers (delq buf buffers))))))
3781 3793
3782 ;; Checks. All process output shall exists in the 3794 ;; Checks. All process output shall exists in the
3783 ;; respective buffers. All created files shall be deleted. 3795 ;; respective buffers. All created files shall be deleted.
3796 (tramp--test-message "Checks %s" buffers)
3784 (dolist (buf buffers) 3797 (dolist (buf buffers)
3785 (with-current-buffer buf 3798 (with-current-buffer buf
3786 (should (string-equal (format "%s\n" buf) (buffer-string))))) 3799 (should (string-equal (format "%s\n" buf) (buffer-string)))))
@@ -3792,7 +3805,7 @@ process sentinels. They shall not disturb each other."
3792 (ignore-errors (delete-process (get-buffer-process buf))) 3805 (ignore-errors (delete-process (get-buffer-process buf)))
3793 (ignore-errors (kill-buffer buf))) 3806 (ignore-errors (kill-buffer buf)))
3794 (ignore-errors (cancel-timer timer)) 3807 (ignore-errors (cancel-timer timer))
3795 (ignore-errors (delete-directory tmp-name 'recursive))))) 3808 (ignore-errors (delete-directory tmp-name 'recursive))))))
3796 3809
3797(ert-deftest tramp-test37-recursive-load () 3810(ert-deftest tramp-test37-recursive-load ()
3798 "Check that Tramp does not fail due to recursive load." 3811 "Check that Tramp does not fail due to recursive load."