all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 71988@debbugs.gnu.org
Subject: bug#71988: 31.0.50; ert-test-run-tests-batch-expensive runs out of memory if previous tests failed
Date: Mon, 08 Jul 2024 19:54:25 +0000	[thread overview]
Message-ID: <6c0eElmIpNe7IlK05in9_OGFsEl8V5pIXzstK4dtIKMEFmTRcuODoRybzXGb3M7O7GjZsN2onbJRq4robe_Nd8ivV_NlY8vzYV5SZnMjTIM=@protonmail.com> (raw)
In-Reply-To: <cVt0dZOYriBO6Tpo1lJSHrnbA6ttTZvZIClty3TCFUNMfHf66UhbHi7A329CLnWz5ueIn3ypvcKDLsBynBK8wzd41YA29AKEPDgokIrVsqs=@protonmail.com>

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

On Monday, July 8th, 2024 at 04:49, Pip Cet <pipcet@protonmail.com> wrote:
> This bug report is mostly to get a bug number to put in the patch :-).

Which I'm now attaching. Sorry about that.

Pip

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Bug-71988-Avoid-excessively-large-backtraces-in-ert-.patch --]
[-- Type: text/x-patch; name=0001-Bug-71988-Avoid-excessively-large-backtraces-in-ert-.patch, Size: 1902 bytes --]

From 8f7e9b50f0edd33f601fab0842c5b4a7e4398490 Mon Sep 17 00:00:00 2001
From: Pip Cet <pipcet@protonmail.com>
Date: Mon, 8 Jul 2024 19:50:16 +0000
Subject: [PATCH] (Bug#71988) Avoid excessively large backtraces in ert-tests

* test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-batch-expensive):
Temporarily make `cl-print-object' not print out vectors while running
the test.
---
 test/lisp/emacs-lisp/ert-tests.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 1aff73d66f6..4237d354f38 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -594,9 +594,13 @@ ert-test-run-tests-batch-expensive
 			 :body (lambda () (should (equal complex-list 1))))))
     (let ((ert-debug-on-error nil)
           messages)
-      (cl-letf* (((symbol-function 'message)
+      (cl-letf* (((symbol-function 'cl-print-object) (symbol-function 'cl-print-object))
+                 ((symbol-function 'message)
                   (lambda (format-string &rest args)
                     (push (apply #'format format-string args) messages))))
+        ;; don't print the ert--stats-tests vector, which would run out of
+        ;; memory if previous tests have failed.
+        (cl-defmethod cl-print-object ((object vector) stream))
         (save-window-excursion
           (let ((case-fold-search nil)
                 (ert-batch-backtrace-right-margin nil)
@@ -611,7 +615,9 @@ ert-test-run-tests-batch-expensive
 		 do
 		 (unless found-frame
 		   (setq found-frame (cl-search frame msg :test 'equal))))
-        (should found-frame)))))
+        (should found-frame))))
+  ;; ensure our temporary binding was undone.
+  (should (equal (cl-prin1-to-string [a]) "[a]")))
 
 (ert-deftest ert-test-special-operator-p ()
   (should (ert--special-operator-p 'if))
-- 
2.45.2


      parent reply	other threads:[~2024-07-08 19:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08  4:49 bug#71988: 31.0.50; ert-test-run-tests-batch-expensive runs out of memory if previous tests failed Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-08 11:17 ` Eli Zaretskii
2024-07-08 19:54 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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

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

  git send-email \
    --in-reply-to='6c0eElmIpNe7IlK05in9_OGFsEl8V5pIXzstK4dtIKMEFmTRcuODoRybzXGb3M7O7GjZsN2onbJRq4robe_Nd8ivV_NlY8vzYV5SZnMjTIM=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=71988@debbugs.gnu.org \
    --cc=pipcet@protonmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.