emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 64f2c96 2/2: Make a process test faster.


From: Philipp Stephani
Subject: master 64f2c96 2/2: Make a process test faster.
Date: Sat, 2 Jan 2021 07:55:36 -0500 (EST)

branch: master
commit 64f2c96cbe3ba803c4026c976c425771911e29e3
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>

    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.
---
 test/src/process-tests.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e1e2506..5294bc0 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]