all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#44317: [PATCH] cperl-mode: Make timeout tests more robust
@ 2020-10-29 21:09 Harald Jörg
  2020-10-29 21:49 ` Stefan Kangas
  0 siblings, 1 reply; 2+ messages in thread
From: Harald Jörg @ 2020-10-29 21:09 UTC (permalink / raw)
  To: 44317

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

One of the tests in cperl-mode-tests.el starts an external Emacs process
under timeout to check for an endless loop.  It turns out that the
timeout of 1 sec is rather short for slower machines.  Thanks to recent
ERT which now reports the run time in batch tests, I saw that it takes
about 0.7 seconds on my machine, so I increased the timeout to 2
seconds.

I also flagged the test as "expensive" and skip it under older Emacs
versions (I run tests for Emacs version 26.1 and above).

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cperl-mode: Make timeout tests more robust --]
[-- Type: text/x-diff, Size: 1709 bytes --]

From b169038b5d619907f2513de944e4515bf7524d53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Harald=20J=C3=B6rg?= <haj@posteo.de>
Date: Thu, 29 Oct 2020 22:06:56 +0100
Subject: [PATCH] cperl-mode: Make timeout test more robust

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-bug-10483): Increase the timeout to 2 seconds
and mark the test as expensive.  Also, suppress it for Emacs
versions below 28, where the test times out though the function
works quite fine in manual tests.
---
 test/lisp/progmodes/cperl-mode-tests.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
index e67678cf6b..9b486ae2e2 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -108,8 +108,10 @@ cperl-mode-test-bug-10483
 without a statement terminator on the same line does not loop
 forever.  The test starts an asynchronous Emacs batch process
 under timeout control."
+  :tags '(:expensive-test)
   (interactive)
   (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; FIXME times out
+  (skip-unless (not (< emacs-major-version 28))) ; times out in older Emacsen
   (let* ((emacs (concat invocation-directory invocation-name))
          (test-function 'cperl-mode-test--run-bug-10483)
          (test-function-name (symbol-name test-function))
@@ -118,7 +120,7 @@ cperl-mode-test-bug-10483
          (process-connection-type nil)
          runner)
     (with-temp-buffer
-      (with-timeout (1
+      (with-timeout (2
                      (delete-process runner)
                      (setq ran-out-of-time t))
         (setq runner (start-process "speedy"
-- 
2.20.1


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

* bug#44317: [PATCH] cperl-mode: Make timeout tests more robust
  2020-10-29 21:09 bug#44317: [PATCH] cperl-mode: Make timeout tests more robust Harald Jörg
@ 2020-10-29 21:49 ` Stefan Kangas
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Kangas @ 2020-10-29 21:49 UTC (permalink / raw)
  To: Harald Jörg, 44317

close 44317 28.1
thanks

haj@posteo.de (Harald Jörg) writes:

> One of the tests in cperl-mode-tests.el starts an external Emacs process
> under timeout to check for an endless loop.  It turns out that the
> timeout of 1 sec is rather short for slower machines.  Thanks to recent
> ERT which now reports the run time in batch tests, I saw that it takes
> about 0.7 seconds on my machine, so I increased the timeout to 2
> seconds.
>
> I also flagged the test as "expensive" and skip it under older Emacs
> versions (I run tests for Emacs version 26.1 and above).

Thanks, makes sense.  Pushed to master as commit 96e371b44a.





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

end of thread, other threads:[~2020-10-29 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-29 21:09 bug#44317: [PATCH] cperl-mode: Make timeout tests more robust Harald Jörg
2020-10-29 21:49 ` Stefan Kangas

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.