GNU bug report logs -
#51177
29.0.50; stop-process on pipes
Previous Next
Full log
Message #71 received at 51177 <at> debbugs.gnu.org (full text, mbox):
On Fri, Nov 12 2021, Eli Zaretskii wrote:
> Thanks. Can you show a recipe for testing this?
Create a file with this code:
(ert-deftest test-read-after-exit ()
(let* ((output "")
(filter (lambda (p s) (setq output (concat output s))))
(sentinel (lambda (p _)
(set-process-filter p filter)
(while (accept-process-output p 0))))
(proc (make-process :command '("printf" "foo")
:name "test-proc"
:filter t
:sentinel sentinel)))
(while (process-live-p proc)
(accept-process-output proc 0.2))
(should (equal output "foo"))))
and execute: emacs -Q --batch -l test.el -f ert-run-tests-batch-and-exit
However, if delete-process is called from the sentinel like so
(ert-deftest test-delete-proces ()
(let* ((output "")
(filter (lambda (p s) (setq output (concat output s))))
(sentinel (lambda (p _)
(set-process-filter p filter)
(while (accept-process-output p 0))
(delete-process p)))
(proc (make-process :command '("printf" "foo")
:name "test-proc"
:filter t
:sentinel sentinel)))
(while (process-live-p proc)
(accept-process-output proc 0.2))
(should (equal output "foo"))))
then it produces an endless loop.
Helmut
This bug report was last modified 3 years and 312 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.