summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2021-01-02 13:53:17 +0100
committerPhilipp Stephani <phst@google.com>2021-01-02 13:53:17 +0100
commit64f2c96cbe3ba803c4026c976c425771911e29e3 (patch)
tree1a18b4b1cb39eb6a3ca2b4b1e74a132d36543a8c /test/src
parentdf605870fde7e31d2ca76fd7e69961ba94604a34 (diff)
downloademacs-64f2c96cbe3ba803c4026c976c425771911e29e3.tar.gz
Make a process test faster.
The test 'process-tests/fd-setsize-no-crash/make-process' used to call 'sleep' to ensure that enough processes are live to trigger a FD_SETSIZE overflow. However, we can just call 'cat' instead and close standard input when done. That way, we only wait as long as needed. * process-tests.el (process-tests/fd-setsize-no-crash/make-process): Invoke 'cat' instead of 'sleep'. Close standard input to exit the 'cat' processes.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/process-tests.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e1e25068e4a..5294bc07ce5 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -535,8 +535,8 @@ Afterwards, delete the directory."
"Check that Emacs doesn't crash when trying to use more than
FD_SETSIZE file descriptors (Bug#24325)."
(with-timeout (60 (ert-fail "Test timed out"))
- (let ((sleep (executable-find "sleep")))
- (skip-unless sleep)
+ (let ((cat (executable-find "cat")))
+ (skip-unless cat)
(dolist (conn-type '(pipe pty))
(ert-info ((format "Connection type `%s'" conn-type))
(process-tests--fd-setsize-test
@@ -552,7 +552,7 @@ FD_SETSIZE file descriptors (Bug#24325)."
;; ignore `file-error'.
(process-tests--ignore-EMFILE
(make-process :name (format "test %d" i)
- :command (list sleep "5")
+ :command (list cat)
:connection-type conn-type
:coding 'no-conversion
:noquery t))))
@@ -560,6 +560,8 @@ FD_SETSIZE file descriptors (Bug#24325)."
;; We should have managed to start at least one process.
(should processes)
(dolist (process processes)
+ (should (process-live-p process))
+ (process-send-eof process)
(while (accept-process-output process))
(should (eq (process-status process) 'exit))
;; If there's an error between fork and exec, Emacs