aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/process-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/process-tests.el')
-rw-r--r--test/src/process-tests.el23
1 files changed, 21 insertions, 2 deletions
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 5294bc07ce5..921bcd5f85b 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -560,8 +560,16 @@ FD_SETSIZE file descriptors (Bug#24325)."
560 ;; We should have managed to start at least one process. 560 ;; We should have managed to start at least one process.
561 (should processes) 561 (should processes)
562 (dolist (process processes) 562 (dolist (process processes)
563 (should (process-live-p process)) 563 ;; The process now should either be running, or have
564 (process-send-eof process) 564 ;; already failed before `exec'.
565 (should (memq (process-status process) '(run exit)))
566 (when (process-live-p process)
567 (process-send-eof process))
568 ;; FIXME: This `sleep-for' shouldn't be needed. It
569 ;; indicates a bug in Emacs; perhaps SIGCHLD is
570 ;; received in parallel with `accept-process-output',
571 ;; causing the latter to hang.
572 (sleep-for 0.1)
565 (while (accept-process-output process)) 573 (while (accept-process-output process))
566 (should (eq (process-status process) 'exit)) 574 (should (eq (process-status process) 'exit))
567 ;; If there's an error between fork and exec, Emacs 575 ;; If there's an error between fork and exec, Emacs
@@ -643,6 +651,8 @@ FD_SETSIZE file descriptors (Bug#24325)."
643(ert-deftest process-tests/fd-setsize-no-crash/make-serial-process () 651(ert-deftest process-tests/fd-setsize-no-crash/make-serial-process ()
644 "Check that Emacs doesn't crash when trying to use more than 652 "Check that Emacs doesn't crash when trying to use more than
645FD_SETSIZE file descriptors (Bug#24325)." 653FD_SETSIZE file descriptors (Bug#24325)."
654 ;; This test cannot be run if PTYs aren't supported.
655 (skip-unless (not (eq system-type 'windows-nt)))
646 (with-timeout (60 (ert-fail "Test timed out")) 656 (with-timeout (60 (ert-fail "Test timed out"))
647 (process-tests--with-processes processes 657 (process-tests--with-processes processes
648 ;; In order to use `make-serial-process', we need to create some 658 ;; In order to use `make-serial-process', we need to create some
@@ -664,6 +674,15 @@ FD_SETSIZE file descriptors (Bug#24325)."
664 (tty-name (process-tty-name host))) 674 (tty-name (process-tty-name host)))
665 (should (processp host)) 675 (should (processp host))
666 (push host processes) 676 (push host processes)
677 ;; FIXME: The assumption below that using :connection 'pty
678 ;; in make-process necessarily produces a process with PTY
679 ;; connection is unreliable and non-portable.
680 ;; make-process can legitimately and silently fall back on
681 ;; pipes if allocating a PTY fails (and on MS-Windows it
682 ;; always fails). The following code also assumes that
683 ;; process-tty-name produces a file name that can be
684 ;; passed to 'stat' and to make-serial-process, which is
685 ;; also non-portable.
667 (should tty-name) 686 (should tty-name)
668 (should (file-exists-p tty-name)) 687 (should (file-exists-p tty-name))
669 (should-not (member tty-name tty-names)) 688 (should-not (member tty-name tty-names))