GNU bug report logs - #72004
30.0.50, master: 'erc--check-prompt-input-for-multiline-blanks' test fail

Previous Next

Package: emacs;

Reported by: Andrea Corallo <acorallo <at> gnu.org>

Date: Tue, 9 Jul 2024 08:09:01 UTC

Severity: normal

Found in version 30.0.50

Done: Andrea Corallo <acorallo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72004 in the body.
You can then email your comments to 72004 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72004; Package emacs. (Tue, 09 Jul 2024 08:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrea Corallo <acorallo <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 09 Jul 2024 08:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <acorallo <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50, master: 'erc--check-prompt-input-for-multiline-blanks'
 test fail
Date: Tue, 09 Jul 2024 04:08:06 -0400
Since few days I see 'erc--check-prompt-input-for-multiline-blanks'
failing.  I think the fail is intermittent and because of that I could
not determine the commit that introduced it.

I observe this both on emacs-30 both on master, the first commit in
emacs-30 where I observed it is 2fb6a98ecfa1579273a640e923f2e52f75e1f7ad
which seems unrelated (but I mention it so we have a point in time).

This is the output I see:

Test erc--check-prompt-input-for-multiline-blanks backtrace:
  user-error("Process not running")
  erc--run-input-validation-checks(#s(erc--input-split :string "a" :in
  run-hook-with-args(erc--run-input-validation-checks #s(erc--input-sp
  erc-send-current-line()
  #f(compiled-function (next) #<bytecode 0x1eab02298fb35043>)(#f(lambd
  funcall(#f(compiled-function (next) #<bytecode 0x1eab02298fb35043>)
  (progn (fset 'erc-server-buffer vnew) (fset 'erc-process-input-line
  (unwind-protect (progn (fset 'erc-server-buffer vnew) (fset 'erc-pro
  (let* ((vnew #'(lambda (&rest r) (setq calls (cons r calls)))) (vnew
  (let* ((erc--input-review-functions (remove 'erc-add-to-input-ring e
  (save-current-buffer (set-buffer (get-buffer-create "FakeNet")) (let
  erc-tests-common-with-process-input-spy(#f(compiled-function (next)
  #f(compiled-function () #<bytecode -0xaf493cb21b42d4b>)()
  #f(compiled-function () #<bytecode -0x1a6c2873f655e48c>)()
  handler-bind-1(#f(compiled-function () #<bytecode -0x1a6c2873f655e48
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name erc--check-prompt-input-for-multiline
  ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
  ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
  ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
  ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
  eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
  command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
  command-line()
  normal-top-level()
Test erc--check-prompt-input-for-multiline-blanks condition:
    Info: Opts: (+wb -sw), Input: "a", want: (a)
    (user-error "Process not running")
   FAILED   5/95  erc--check-prompt-input-for-multiline-blanks (10.525627 sec) at lisp/erc/erc-tests.el:1637


  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72004; Package emacs. (Tue, 09 Jul 2024 11:42:01 GMT) Full text and rfc822 format available.

Message #8 received at 72004 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <acorallo <at> gnu.org>, "F. Jason Park" <jp <at> neverwas.me>
Cc: 72004 <at> debbugs.gnu.org
Subject: Re: bug#72004: 30.0.50,
 master: 'erc--check-prompt-input-for-multiline-blanks' test fail
Date: Tue, 09 Jul 2024 14:41:14 +0300
> From: Andrea Corallo <acorallo <at> gnu.org>
> Date: Tue, 09 Jul 2024 04:08:06 -0400
> 
> Since few days I see 'erc--check-prompt-input-for-multiline-blanks'
> failing.  I think the fail is intermittent and because of that I could
> not determine the commit that introduced it.
> 
> I observe this both on emacs-30 both on master, the first commit in
> emacs-30 where I observed it is 2fb6a98ecfa1579273a640e923f2e52f75e1f7ad
> which seems unrelated (but I mention it so we have a point in time).
> 
> This is the output I see:
> 
> Test erc--check-prompt-input-for-multiline-blanks backtrace:
>   user-error("Process not running")
>   erc--run-input-validation-checks(#s(erc--input-split :string "a" :in
>   run-hook-with-args(erc--run-input-validation-checks #s(erc--input-sp
>   erc-send-current-line()
>   #f(compiled-function (next) #<bytecode 0x1eab02298fb35043>)(#f(lambd
>   funcall(#f(compiled-function (next) #<bytecode 0x1eab02298fb35043>)
>   (progn (fset 'erc-server-buffer vnew) (fset 'erc-process-input-line
>   (unwind-protect (progn (fset 'erc-server-buffer vnew) (fset 'erc-pro
>   (let* ((vnew #'(lambda (&rest r) (setq calls (cons r calls)))) (vnew
>   (let* ((erc--input-review-functions (remove 'erc-add-to-input-ring e
>   (save-current-buffer (set-buffer (get-buffer-create "FakeNet")) (let
>   erc-tests-common-with-process-input-spy(#f(compiled-function (next)
>   #f(compiled-function () #<bytecode -0xaf493cb21b42d4b>)()
>   #f(compiled-function () #<bytecode -0x1a6c2873f655e48c>)()
>   handler-bind-1(#f(compiled-function () #<bytecode -0x1a6c2873f655e48
>   ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
>   ert-run-test(#s(ert-test :name erc--check-prompt-input-for-multiline
>   ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
>   ert-run-tests((not (or (tag :expensive-test) (tag :unstable))) #f(co
>   ert-run-tests-batch((not (or (tag :expensive-test) (tag :unstable)))
>   ert-run-tests-batch-and-exit((not (or (tag :expensive-test) (tag :un
>   eval((ert-run-tests-batch-and-exit '(not (or (tag :expensive-test) (
>   command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l
>   command-line()
>   normal-top-level()
> Test erc--check-prompt-input-for-multiline-blanks condition:
>     Info: Opts: (+wb -sw), Input: "a", want: (a)
>     (user-error "Process not running")
>    FAILED   5/95  erc--check-prompt-input-for-multiline-blanks (10.525627 sec) at lisp/erc/erc-tests.el:1637

Adding the ERC developer to the discussion.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72004; Package emacs. (Thu, 11 Jul 2024 07:11:02 GMT) Full text and rfc822 format available.

Message #11 received at 72004 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: Andrea Corallo <acorallo <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, emacs-erc <at> gnu.org, 72004 <at> debbugs.gnu.org
Subject: Re: bug#72004: 30.0.50, master:
 'erc--check-prompt-input-for-multiline-blanks' test fail
Date: Thu, 11 Jul 2024 00:10:16 -0700
Hi Andrea,

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Andrea Corallo <acorallo <at> gnu.org>
>> Date: Tue, 09 Jul 2024 04:08:06 -0400
>> 
>> Since few days I see 'erc--check-prompt-input-for-multiline-blanks'
>> failing.  I think the fail is intermittent and because of that I could
>> not determine the commit that introduced it.
>> 
>> I observe this both on emacs-30 both on master, the first commit in
>> emacs-30 where I observed it is 2fb6a98ecfa1579273a640e923f2e52f75e1f7ad
>> which seems unrelated (but I mention it so we have a point in time).

I've not yet witnessed the test in question fail, but I can definitely
imagine it doing so because it's rather flimsy, which is my bad. I've
therefore attempted a superficial fix on the release branch:

  ef3f26ec02d ; Tag ERC multiline blanks test as :expensive

Here's what (I think) is going on. That test relies on the macro
`ert-with-message-capture'. Because that macro advises a few primitive
functions, its first appearance in any make-check run exhibits a
trampoline penalty in terms of execution time (as I'm sure you, more
than anyone, are acutely aware). For example, if you put this at the
bottom of test/lisp/emacs-lisp/ert-x-tests.el

  (ert-deftest ert-with-message-capture/1 ()
    (ert-with-message-capture string (ignore string)))
  
  (ert-deftest ert-with-message-capture/2 ()
    (ert-with-message-capture string (ignore string)))

you'll notice the first takes upwards of a few seconds (when built with
debugging symbols), while subsequent occurrences are comparatively free:

  passed  21/30  ert-with-message-capture/1 (3.067526 sec)
  passed  22/30  ert-with-message-capture/2 (0.000396 sec)

I think it's possible that this phenomenon, combined with added CPU
pressure from unbounded "make -j" runs, may account for the intermittent
failures you've been seeing. And correct me if I'm wrong, but I'm
guessing that during parallel make-check runs, the first occurrence of
`ert-with-message-capture' in any one file always incurs such a penalty
because `ert-run-tests-batch-and-exit' deletes its .eln cache on exit
and "make -j" runs every test file in a separate process.

(Incidentally, I count eleven files in the suite currently using this
macro. Granted, none likely depends on a brittle hard timeout, like the
"sleep 10" in my test, so there's surely no risk of similar failures,
but if the mere appearance of that macro or ones like it translates to
noticeable overhead, perhaps it's worth looking into eventually.)

Anyway, thanks for bringing this to ERC's attention.

J.P.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72004; Package emacs. (Thu, 11 Jul 2024 08:26:01 GMT) Full text and rfc822 format available.

Message #14 received at 72004 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <acorallo <at> gnu.org>
To: "J.P." <jp <at> neverwas.me>
Cc: Eli Zaretskii <eliz <at> gnu.org>, emacs-erc <at> gnu.org, 72004 <at> debbugs.gnu.org
Subject: Re: bug#72004: 30.0.50, master:
 'erc--check-prompt-input-for-multiline-blanks' test fail
Date: Thu, 11 Jul 2024 04:24:45 -0400
"J.P." <jp <at> neverwas.me> writes:

> Hi Andrea,
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Andrea Corallo <acorallo <at> gnu.org>
>>> Date: Tue, 09 Jul 2024 04:08:06 -0400
>>> 
>>> Since few days I see 'erc--check-prompt-input-for-multiline-blanks'
>>> failing.  I think the fail is intermittent and because of that I could
>>> not determine the commit that introduced it.
>>> 
>>> I observe this both on emacs-30 both on master, the first commit in
>>> emacs-30 where I observed it is 2fb6a98ecfa1579273a640e923f2e52f75e1f7ad
>>> which seems unrelated (but I mention it so we have a point in time).
>
> I've not yet witnessed the test in question fail, but I can definitely
> imagine it doing so because it's rather flimsy, which is my bad. I've
> therefore attempted a superficial fix on the release branch:
>
>   ef3f26ec02d ; Tag ERC multiline blanks test as :expensive
>
> Here's what (I think) is going on. That test relies on the macro
> `ert-with-message-capture'. Because that macro advises a few primitive
> functions, its first appearance in any make-check run exhibits a
> trampoline penalty in terms of execution time (as I'm sure you, more
> than anyone, are acutely aware). For example, if you put this at the
> bottom of test/lisp/emacs-lisp/ert-x-tests.el
>
>   (ert-deftest ert-with-message-capture/1 ()
>     (ert-with-message-capture string (ignore string)))
>   
>   (ert-deftest ert-with-message-capture/2 ()
>     (ert-with-message-capture string (ignore string)))
>
> you'll notice the first takes upwards of a few seconds (when built with
> debugging symbols), while subsequent occurrences are comparatively free:
>
>   passed  21/30  ert-with-message-capture/1 (3.067526 sec)
>   passed  22/30  ert-with-message-capture/2 (0.000396 sec)
>
> I think it's possible that this phenomenon, combined with added CPU
> pressure from unbounded "make -j" runs, may account for the intermittent
> failures you've been seeing. And correct me if I'm wrong, but I'm
> guessing that during parallel make-check runs, the first occurrence of
> `ert-with-message-capture' in any one file always incurs such a penalty
> because `ert-run-tests-batch-and-exit' deletes its .eln cache on exit
> and "make -j" runs every test file in a separate process.
>
> (Incidentally, I count eleven files in the suite currently using this
> macro. Granted, none likely depends on a brittle hard timeout, like the
> "sleep 10" in my test, so there's surely no risk of similar failures,
> but if the mere appearance of that macro or ones like it translates to
> noticeable overhead, perhaps it's worth looking into eventually.)
>
> Anyway, thanks for bringing this to ERC's attention.

Hi J.P.,

I buy the theory of this being related to trampoline generation under
high system load, looking at my logs I see this test failing only with
native compilation an passing without.

I'm wondering if we could work around the issue somehow 🤔

Also I'm not sure the right tag is :expensive, shouldn't be :unstable?

Thanks!

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72004; Package emacs. (Thu, 11 Jul 2024 18:27:02 GMT) Full text and rfc822 format available.

Message #17 received at 72004 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: Andrea Corallo <acorallo <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, emacs-erc <at> gnu.org, 72004 <at> debbugs.gnu.org
Subject: Re: bug#72004: 30.0.50, master:
 'erc--check-prompt-input-for-multiline-blanks' test fail
Date: Thu, 11 Jul 2024 11:26:15 -0700
Andrea Corallo <acorallo <at> gnu.org> writes:

> I buy the theory of this being related to trampoline generation under
> high system load, looking at my logs I see this test failing only with
> native compilation an passing without.
>
> I'm wondering if we could work around the issue somehow 🤔

I'm afraid I can offer next to nothing when it comes to serious insights
about Emacs internals and related magic 😞

>
> Also I'm not sure the right tag is :expensive, shouldn't be :unstable?

If we want to prevent the test from running completely (at least on
EMBA), then :unstable would indeed make sense. However, if we'd like the
test to run on the 3x daily expensive pipelines, I'm fairly confident my
latest change sidesteps the issue. It now waits to start the subprocess,
which was previously too short-lived, until after the macro has done its
(potentially time-consuming) advising. Thus, the liveliness check that
was signaling the error should now always find a running process.
(Although, for good measure, I also lengthened the timeout from 10s to
5m.) All this said, I'm happy to change it to :unstable or try a safer
approach, such as mocking `process-status'. Thanks.




Reply sent to Andrea Corallo <acorallo <at> gnu.org>:
You have taken responsibility. (Fri, 12 Jul 2024 07:32:02 GMT) Full text and rfc822 format available.

Notification sent to Andrea Corallo <acorallo <at> gnu.org>:
bug acknowledged by developer. (Fri, 12 Jul 2024 07:32:02 GMT) Full text and rfc822 format available.

Message #22 received at 72004-done <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <acorallo <at> gnu.org>
To: "J.P." <jp <at> neverwas.me>
Cc: Eli Zaretskii <eliz <at> gnu.org>, emacs-erc <at> gnu.org, 72004-done <at> debbugs.gnu.org
Subject: Re: bug#72004: 30.0.50, master:
 'erc--check-prompt-input-for-multiline-blanks' test fail
Date: Fri, 12 Jul 2024 03:30:55 -0400
"J.P." <jp <at> neverwas.me> writes:

> Andrea Corallo <acorallo <at> gnu.org> writes:
>
>> I buy the theory of this being related to trampoline generation under
>> high system load, looking at my logs I see this test failing only with
>> native compilation an passing without.
>>
>> I'm wondering if we could work around the issue somehow 🤔
>
> I'm afraid I can offer next to nothing when it comes to serious insights
> about Emacs internals and related magic 😞
>
>>
>> Also I'm not sure the right tag is :expensive, shouldn't be :unstable?
>
> If we want to prevent the test from running completely (at least on
> EMBA), then :unstable would indeed make sense. However, if we'd like the
> test to run on the 3x daily expensive pipelines, I'm fairly confident my
> latest change sidesteps the issue. It now waits to start the subprocess,
> which was previously too short-lived, until after the macro has done its
> (potentially time-consuming) advising. Thus, the liveliness check that
> was signaling the error should now always find a running process.
> (Although, for good measure, I also lengthened the timeout from 10s to
> 5m.) All this said, I'm happy to change it to :unstable or try a safer
> approach, such as mocking `process-status'. Thanks.

Generally speaking I think we should flag tests for what they are and
then tune the EMBA testing strategy to our needs afterward.  That said
with a 5m timeout the test is now probably more expansive than unstable
so I think the classificaiton it's fine :)

Thanks closing this.

  Andrea




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 09 Aug 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 87 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.