unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64975: 30.0.50; accept-process-output and async connect
@ 2023-07-31 13:31 Helmut Eller
  2023-08-05  9:26 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Helmut Eller @ 2023-07-31 13:31 UTC (permalink / raw)
  To: 64975

[-- Attachment #1: Type: text/plain, Size: 21 bytes --]

This example fails:


[-- Attachment #2: async-connect.el --]
[-- Type: text/plain, Size: 467 bytes --]


(ert-deftest async-connect ()
  (let* ((host 'local)
	 (family 'ipv4)
	 (port 57869)
	 (server (make-network-process
		  :name "server" :server t :noquery t :reuseaddr t
		  :host host :service port :family family))
	 (proc (make-network-process
		:name "async-connect" :nowait t
		:host host :service port :family family)))
    (should (eq (process-status proc) 'connect))
    (should (accept-process-output proc 2))
    (should (eq (process-status proc) 'open))))

[-- Attachment #3: Type: text/plain, Size: 252 bytes --]


when executed with
  emacs --batch -Q -l async-connect.el -f ert-run-tests-batch-and-exit

It seems that accept-process-output correctly updates the process-status
but it forgets to break out of the loop.

With the following change, the test passes:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: async-wait.patch --]
[-- Type: text/x-diff, Size: 466 bytes --]

diff --git a/src/process.c b/src/process.c
index 2d6e08f16b5..159d39aeabc 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6024,6 +6024,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 #endif
 		    {
 		      pset_status (p, Qrun);
+		      got_some_output = 1;
 		      /* Execute the sentinel here.  If we had relied on
 			 status_notify to do it later, it will read input
 			 from the process before calling the sentinel.  */

[-- Attachment #5: Type: text/plain, Size: 794 bytes --]




In GNU Emacs 30.0.50 (build 73, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.16.0) of 2023-07-31 built on caladan
Repository revision: 1f3995f65a065a28e108653128b31a2fb7eeb01c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --with-xpm=ifavailable --with-jpeg=ifavailable
 --with-gif=ifavailable --with-tiff=ifavailable'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSELINUX
LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 GTK3
ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-08 15:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-31 13:31 bug#64975: 30.0.50; accept-process-output and async connect Helmut Eller
2023-08-05  9:26 ` Eli Zaretskii
2023-08-08  9:10   ` Robert Pluim
2023-08-08 12:15     ` Eli Zaretskii
2023-08-08 12:32       ` Robert Pluim
2023-08-08 14:36     ` Helmut Eller
2023-08-08 15:16       ` Robert Pluim
2023-08-08 15:33         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).