From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 14:17:26 +0300 Message-ID: <868qyc16bd.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24970"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71988@debbugs.gnu.org To: Pip Cet , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 08 13:18:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sQmNy-0006G7-DO for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Jul 2024 13:18:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQmNb-0003fQ-F8; Mon, 08 Jul 2024 07:17:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQmNZ-0003f2-4I for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2024 07:17:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQmNY-0003a0-Rx for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2024 07:17:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQmNd-00061j-Kk for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2024 07:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Jul 2024 11:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71988 X-GNU-PR-Package: emacs Original-Received: via spool by 71988-submit@debbugs.gnu.org id=B71988.172043746823145 (code B ref 71988); Mon, 08 Jul 2024 11:18:01 +0000 Original-Received: (at 71988) by debbugs.gnu.org; 8 Jul 2024 11:17:48 +0000 Original-Received: from localhost ([127.0.0.1]:49819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQmNQ-00061F-1g for submit@debbugs.gnu.org; Mon, 08 Jul 2024 07:17:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQmNN-000612-68 for 71988@debbugs.gnu.org; Mon, 08 Jul 2024 07:17:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQmNB-0003Va-6n; Mon, 08 Jul 2024 07:17:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=OyZZ8Tq2qaEmXD69ZoOuaBUQjsdtIm7XW0jz5cU4uA8=; b=Jwcc171u8K6/ 11k4UJu5Dgq2A69IQaglC0ruF1zNprITfehSOz2s+r7JiFNmGaxW3IBXTgTU0dcW1JgZQACJCH7cx gNHMVuLdpfz9dSHvAvKDiRsDMfYzWSpvCYIN2mD04P9kmrw714joqhCn92uWKAoH7OGEsuG6dDV3n C7x91Py7irRt4fGDT3uXoDpQ8k8x3yNiuGFTHOIbdLODD+n6gysN/I6EncdruM50tN2p2Dw7LBf7X S0tv8eviYNTJgf4vKs0haaUO19i1UlELgRKPZQcQ+Qga5cy22D+C2KDoczjoQbjU8krYafZeZ28qm XK1UsVGKBgm8/Sds602HLw==; In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288587 Archived-At: > Date: Mon, 08 Jul 2024 04:49:54 +0000 > From: Pip Cet via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > This bug report is mostly to get a bug number to put in the patch :-). > > The test `ert-test-run-tests-batch-expensive' overrides print settings > and prints a full backtrace to a temporary buffer repeatedly. If a > previous test, such as `ert-test-run-tests-batch', failed, this > eventually runs out of memory even on a 64 GB system. > > For example, one can add "(should nil)" to ert-test-run-tests-batch and > run: > > $ make -C test lisp/emacs-lisp/ert-tests > > The problem is the ert--stats structure's tests vector is being printed, > which recursively prints all previous tests' data. > > A possible fix is to temporarily override cl-print-object for either > vectors or the ert--stats object to print nothing. > > Unfortunately, we don't appear to have an official mechanism for > temporarily calling cl-defmethod, such as a generalized variable one can > cl-letf to. The patch does that by running cl-defmethod inside a > (cl-letf* (((symbol-function 'cl-print-object) (symbol-function > 'cl-print-object))) ...) form. As future changes to cl-generic might > break that, an additional test is added to make sure our binding is > undone and die loudly if it hasn't been. > > This also speeds up the test significantly and it might be possible to > remove the :unstable tag. > > > diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el > index 1aff73d66f6..2f8e7382bea 100644 > --- a/test/lisp/emacs-lisp/ert-tests.el > +++ b/test/lisp/emacs-lisp/ert-tests.el > @@ -583,6 +583,7 @@ ert-test-run-tests-batch > (setq found-long (string-match long-text msg))) > (unless found-complex > (setq found-complex (string-match complex-text msg)))) > + (should nil) > (should found-long) > (should found-complex))))) Stefan, any comments or suggestions?