Commit 18c02f7e authored by Michael Albinus's avatar Michael Albinus

* test/lisp/net/tramp-tests.el (tramp-test43-asynchronous-requests):

Make it fit for tramp-adb.  Apply better check in process filter.
parent 5e55b1b8
Pipeline #1156 failed with stage
in 39 minutes and 59 seconds
...@@ -3923,6 +3923,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ...@@ -3923,6 +3923,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
:tags '(:expensive-test) :tags '(:expensive-test)
(skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-enabled))
(skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
;; `make-process' supports file name handlers since Emacs 27.
(skip-unless (tramp--test-emacs27-p)) (skip-unless (tramp--test-emacs27-p))
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
...@@ -5362,20 +5363,14 @@ process sentinels. They shall not disturb each other." ...@@ -5362,20 +5363,14 @@ process sentinels. They shall not disturb each other."
;; we mark it as unstable. ;; we mark it as unstable.
:tags '(:expensive-test :unstable) :tags '(:expensive-test :unstable)
(skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p)) (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
;; This test is sensible wrt to other running tests. Let it work
;; only if it is the only selected test.
;; FIXME: There must be a better solution.
(skip-unless
(= 1 (length
(ert-select-tests (ert--stats-selector ert--current-run-stats) t))))
(with-timeout (with-timeout
(tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler)) (tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler))
(define-key special-event-map [sigusr1] #'tramp--test-timeout-handler) (define-key special-event-map [sigusr1] #'tramp--test-timeout-handler)
(let* (;; For the watchdog. (let* (;; For the watchdog.
(default-directory (expand-file-name temporary-file-directory)) (default-directory (expand-file-name temporary-file-directory))
(shell-file-name "/bin/sh") (shell-file-name (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh"))
(watchdog (watchdog
(start-process-shell-command (start-process-shell-command
"*watchdog*" nil "*watchdog*" nil
...@@ -5475,7 +5470,7 @@ process sentinels. They shall not disturb each other." ...@@ -5475,7 +5470,7 @@ process sentinels. They shall not disturb each other."
"Process filter %s %s %s" proc string (current-time-string)) "Process filter %s %s %s" proc string (current-time-string))
(with-current-buffer (process-buffer proc) (with-current-buffer (process-buffer proc)
(insert string)) (insert string))
(unless (zerop (length string)) (when (< (process-get proc 'bar) 2)
(dired-uncache (process-get proc 'foo)) (dired-uncache (process-get proc 'foo))
(should (file-attributes (process-get proc 'foo)))))) (should (file-attributes (process-get proc 'foo))))))
;; Add process sentinel. It shall not perform remote ;; Add process sentinel. It shall not perform remote
...@@ -5528,7 +5523,12 @@ process sentinels. They shall not disturb each other." ...@@ -5528,7 +5523,12 @@ process sentinels. They shall not disturb each other."
(dolist (buf buffers) (dolist (buf buffers)
(with-current-buffer buf (with-current-buffer buf
(should (should
(string-equal (format "%s\n%s\n" buf buf) (buffer-string))))) (string-equal
;; tramp-adb.el echoes, so we must add the three strings.
(if (tramp--test-adb-p)
(format "%s\n%s\n%s\n%s\n%s\n" buf buf buf buf buf)
(format "%s\n%s\n" buf buf))
(buffer-string)))))
(should-not (should-not
(directory-files (directory-files
tmp-name nil directory-files-no-dot-files-regexp))) tmp-name nil directory-files-no-dot-files-regexp)))
...@@ -5729,8 +5729,8 @@ Since it unloads Tramp, it shall be the last test to run." ...@@ -5729,8 +5729,8 @@ Since it unloads Tramp, it shall be the last test to run."
;; do not work properly for `nextcloud'. ;; do not work properly for `nextcloud'.
;; * Fix `tramp-test29-start-file-process' and ;; * Fix `tramp-test29-start-file-process' and
;; `tramp-test30-make-process' on MS Windows (`process-send-eof'?). ;; `tramp-test30-make-process' on MS Windows (`process-send-eof'?).
;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'. ;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'. Looks
;; * Fix `tramp-test44-threads'. ;; like it is resolved now. Remove `:unstable' tag?
(provide 'tramp-tests) (provide 'tramp-tests)
;;; tramp-tests.el ends here ;;; tramp-tests.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment