unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: esh-proc test failures
Date: Tue, 30 Aug 2022 13:56:17 -0700	[thread overview]
Message-ID: <43c8585e-54c3-7be0-683e-17320bcc3b92@gmail.com> (raw)
In-Reply-To: <6ca75c4c-adfc-fdde-cbff-6c76db036eab@gmail.com>

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

On 8/30/2022 9:51 AM, Jim Porter wrote:
> On 8/29/2022 8:18 PM, Jim Porter wrote:
>> Merged as f9250c5ebc1730bf3bed4382549433f52f7ef9ca. Hopefully this 
>> fixes EMBA; if there are any further issues anyone encounters, just 
>> let me know.
> 
> Apparently it doesn't. I've confirmed again locally that my patch does 
> fix *an* issue with 'eshell-pipe-broken', but I guess it's not the same 
> issue as what's on EMBA. I'll see if I can fix EMBA for real, or failing 
> that, we can disable the tests again.

Ok, it looks like this is now failing only for native-comp builds. I 
think the patch I pushed *does* fix the bug, but the regression tests 
need a bit of extra help for native-comp builds.

The attached diff should make it easier for others to see what's going 
on: with "slow-echo", Eshell will always print output after the "sh" 
subprocess has finished, triggering the bug. Then, we need to set 
'debug-on-error' to nil in order to fix this for real. That's because 
Eshell uses 'condition-case-unless-debug' inside 
'eshell-condition-case'. If anyone would like to test this out locally, 
just try out the diff with native-comp on or off and with/without the 
'debug-on-error' overrides.

However, I'm a bit concerned that there's another, more-general bug 
here. Why would native-comp and non-native-comp differ here? I think 
native-comp is doing the right thing, but maybe not... does anyone have 
any ideas here?

In any case, assuming there are no objections, I'll merge a patch that 
just sets 'debug-on-error' to nil in the appropriate spots in 
esh-proc-tests.el in the next day or so. That should fix EMBA.

[-- Attachment #2: fix-tests-under-native-comp.diff --]
[-- Type: text/plain, Size: 2195 bytes --]

diff --git a/test/lisp/eshell/esh-proc-tests.el b/test/lisp/eshell/esh-proc-tests.el
index 2369bb5cc0..51c8f7fcb8 100644
--- a/test/lisp/eshell/esh-proc-tests.el
+++ b/test/lisp/eshell/esh-proc-tests.el
@@ -22,6 +22,7 @@
 (require 'ert)
 (require 'esh-mode)
 (require 'eshell)
+(require 'em-basic)                     ; FIXME: remove this
 
 (require 'eshell-tests-helpers
          (expand-file-name "eshell-tests-helpers"
@@ -35,6 +36,15 @@ esh-proc-test--detect-pty-cmd
           "if [ -t 2 ]; then echo stderr; fi"
           "'"))
 
+;; FIXME: remove this before committing vvv
+(defun eshell/slow-echo (&rest args)
+  "A version of `eshell/echo' that takes a while to print."
+  (let ((total 0))                      ; Busy-loop for a while.
+    (dotimes (i 1000000)
+      (setq total (+ total i))))
+  (eshell/echo args))
+;; FIXME: remove this before committing ^^^
+
 ;;; Tests:
 
 (ert-deftest esh-proc-test/sigpipe-exits-process ()
@@ -76,17 +86,23 @@ esh-proc-test/pipeline-connection-type/middle
 pipeline."
   (skip-unless (and (executable-find "sh")
                     (executable-find "cat")))
-  (eshell-command-result-equal
-   (concat "echo | " esh-proc-test--detect-pty-cmd " | cat")
-   nil))
+  ;; An `eshell-pipe-broken' signal might occur internally; let Eshell
+  ;; handle it!
+  (let ((debug-on-error nil))
+    (eshell-command-result-equal
+     (concat "slow-echo hi | " esh-proc-test--detect-pty-cmd " | cat")
+     nil)))
 
 (ert-deftest esh-proc-test/pipeline-connection-type/last ()
   "Test that only output streams are PTYs when a command ends a pipeline."
   (skip-unless (executable-find "sh"))
-  (eshell-command-result-equal
-   (concat "echo | " esh-proc-test--detect-pty-cmd)
-   (unless (eq system-type 'windows-nt)
-     "stdout\nstderr\n")))
+  ;; An `eshell-pipe-broken' signal might occur internally; let Eshell
+  ;; handle it!
+  (let ((debug-on-error nil))
+    (eshell-command-result-equal
+     (concat "slow-echo hi | " esh-proc-test--detect-pty-cmd)
+     (unless (eq system-type 'windows-nt)
+       "stdout\nstderr\n"))))
 
 (ert-deftest esh-proc-test/kill-pipeline ()
   "Test that killing a pipeline of processes only emits a single

  reply	other threads:[~2022-08-30 20:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166036758418.2203.8730240669199078524@vcs2.savannah.gnu.org>
     [not found] ` <20220813051305.6667BC09BFE@vcs2.savannah.gnu.org>
2022-08-14 18:06   ` esh-proc test failures Lars Ingebrigtsen
2022-08-14 18:44     ` Jim Porter
2022-08-22 17:06       ` Jim Porter
2022-08-22 18:56         ` Eli Zaretskii
2022-08-22 19:23           ` Jim Porter
2022-08-23  2:27             ` Eli Zaretskii
2022-08-23  3:53               ` Jim Porter
2022-08-23 11:37                 ` Eli Zaretskii
2022-08-23 15:57                   ` Jim Porter
2022-08-23 16:22                     ` Eli Zaretskii
2022-08-23 16:38                       ` Jim Porter
2022-08-30  3:18                         ` Jim Porter
2022-08-30 16:51                           ` Jim Porter
2022-08-30 20:56                             ` Jim Porter [this message]
2022-08-31 20:52                               ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43c8585e-54c3-7be0-683e-17320bcc3b92@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).