aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2017-12-16 10:47:06 +0100
committerMichael Albinus2017-12-16 10:47:06 +0100
commitf63d9f86b5688ac84ec6e7eecdbb6cac103dbcf2 (patch)
tree552540925fa6260413ac1d067b9bbc2f65e6fe00 /test
parent506270f9c80bf9bd7dad35a2f0aa6f477da6490b (diff)
downloademacs-f63d9f86b5688ac84ec6e7eecdbb6cac103dbcf2.tar.gz
emacs-f63d9f86b5688ac84ec6e7eecdbb6cac103dbcf2.zip
Suppress timers in Tramp operations
* lisp/net/tramp.el (tramp-accept-process-output): * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-sh-handle-start-file-process): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory) (tramp-smb-handle-file-acl, tramp-smb-handle-process-file) (tramp-smb-handle-set-file-acl) (tramp-smb-handle-start-file-process): Suppress timers. * test/lisp/net/tramp-tests.el (tramp-test41-asynchronous-requests): Use $REMOTE_PARALLEL_PROCESSES. Flush cache prior file operations. Add instrumentation messages.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 5fb3162769b..1bcd3a0f98b 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -33,6 +33,10 @@
33;; remote host, set this environment variable to "/dev/null" or 33;; remote host, set this environment variable to "/dev/null" or
34;; whatever is appropriate on your system. 34;; whatever is appropriate on your system.
35 35
36;; For slow remote connections, `tramp-test41-asynchronous-requests'
37;; might be too heavy. Setting $REMOTE_PARALLEL_PROCESSES to a proper
38;; value less than 10 could help.
39
36;; A whole test run can be performed calling the command `tramp-test-all'. 40;; A whole test run can be performed calling the command `tramp-test-all'.
37 41
38;;; Code: 42;;; Code:
@@ -4504,8 +4508,13 @@ process sentinels. They shall not disturb each other."
4504 (inhibit-message t) 4508 (inhibit-message t)
4505 ;; Do not run delayed timers. 4509 ;; Do not run delayed timers.
4506 (timer-max-repeats 0) 4510 (timer-max-repeats 0)
4507 ;; Number of asynchronous processes for test. 4511 ;; Number of asynchronous processes for test. Tests on
4508 (number-proc 10) 4512 ;; some machines handle less parallel processes.
4513 (number-proc
4514 (or
4515 (ignore-errors
4516 (string-to-number (getenv "REMOTE_PARALLEL_PROCESSES")))
4517 10))
4509 ;; On hydra, timings are bad. 4518 ;; On hydra, timings are bad.
4510 (timer-repeat 4519 (timer-repeat
4511 (cond 4520 (cond
@@ -4571,14 +4580,20 @@ process sentinels. They shall not disturb each other."
4571 (set-process-filter 4580 (set-process-filter
4572 proc 4581 proc
4573 (lambda (proc string) 4582 (lambda (proc string)
4583 (tramp--test-message
4584 "Process filter %s %s %s" proc string (current-time-string))
4574 (with-current-buffer (process-buffer proc) 4585 (with-current-buffer (process-buffer proc)
4575 (insert string)) 4586 (insert string))
4576 (unless (zerop (length string)) 4587 (unless (zerop (length string))
4588 (dired-uncache (process-get proc 'foo))
4577 (should (file-attributes (process-get proc 'foo)))))) 4589 (should (file-attributes (process-get proc 'foo))))))
4578 ;; Add process sentinel. 4590 ;; Add process sentinel.
4579 (set-process-sentinel 4591 (set-process-sentinel
4580 proc 4592 proc
4581 (lambda (proc _state) 4593 (lambda (proc _state)
4594 (tramp--test-message
4595 "Process sentinel %s %s" proc (current-time-string))
4596 (dired-uncache (process-get proc 'foo))
4582 (should-not (file-attributes (process-get proc 'foo))))))) 4597 (should-not (file-attributes (process-get proc 'foo)))))))
4583 4598
4584 ;; Send a string. Use a random order of the buffers. Mix 4599 ;; Send a string. Use a random order of the buffers. Mix
@@ -4594,6 +4609,7 @@ process sentinels. They shall not disturb each other."
4594 (tramp--test-message 4609 (tramp--test-message
4595 "Start action %d %s %s" count buf (current-time-string)) 4610 "Start action %d %s %s" count buf (current-time-string))
4596 ;; Regular operation prior process action. 4611 ;; Regular operation prior process action.
4612 (dired-uncache file)
4597 (if (= count 0) 4613 (if (= count 0)
4598 (should-not (file-attributes file)) 4614 (should-not (file-attributes file))
4599 (should (file-attributes file))) 4615 (should (file-attributes file)))
@@ -4602,7 +4618,10 @@ process sentinels. They shall not disturb each other."
4602 (accept-process-output proc 0.1 nil 0) 4618 (accept-process-output proc 0.1 nil 0)
4603 ;; Give the watchdog a chance. 4619 ;; Give the watchdog a chance.
4604 (read-event nil nil 0.01) 4620 (read-event nil nil 0.01)
4621 (tramp--test-message
4622 "Continue action %d %s %s" count buf (current-time-string))
4605 ;; Regular operation post process action. 4623 ;; Regular operation post process action.
4624 (dired-uncache file)
4606 (if (= count 2) 4625 (if (= count 2)
4607 (should-not (file-attributes file)) 4626 (should-not (file-attributes file))
4608 (should (file-attributes file))) 4627 (should (file-attributes file)))