all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#73036: 29.4; Test failure in erc-networks--id-sort-buffers
@ 2024-09-05  5:59 Ulrich Mueller
  2024-09-05  6:44 ` J.P.
       [not found] ` <87bk1261n1.fsf@neverwas.me>
  0 siblings, 2 replies; 3+ messages in thread
From: Ulrich Mueller @ 2024-09-05  5:59 UTC (permalink / raw)
  To: 73036

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

Forwarding Gentoo bug 920696 <https://bugs.gentoo.org/920696>.

We see the following test failure on an hppa2.0-unknown-linux-gnu
(Linux-6.9.8-gentoo-parisc64-parisc64-PA8900_-Shortfin-with-glibc2.39)
system:

Test erc-networks--id-sort-buffers condition:
    (ert-test-failed
     ((should
       (equal
        (erc-networks--id-sort-buffers ...)
        (list newest middle oldest)))
      :form
      (equal
       (#<killed buffer> #<killed buffer> #<killed buffer>)
       (#<killed buffer> #<killed buffer> #<killed buffer>))
      :value nil :explanation
      (list-elt 0
                (different-atoms #<killed buffer> #<killed buffer>))))
   FAILED   6/41  erc-networks--id-sort-buffers (0.000000 sec) at lisp/erc/erc-networks-tests.el:133

[...]

Ran 41 tests, 40 results as expected, 1 unexpected (2024-09-03 20:09:01+0000, 14
.712021 sec)

1 unexpected results:
   FAILED  erc-networks--id-sort-buffers  ((should (equal (erc-networks--id-sort
-buffers (list oldest newest middle)) (list newest middle oldest))) :form (equal
 (#<killed buffer> #<killed buffer> #<killed buffer>) (#<killed buffer> #<killed buffer> #<killed buffer>)) :value nil :explanation (list-elt 0 (different-atoms #<killed buffer> #<killed buffer>)))

[...]

SUMMARY OF TEST RESULTS
-----------------------
Files examined: 465
Ran 6939 tests, 6675 results as expected, 1 unexpected, 263 skipped
1 files contained unexpected results:
  lisp/erc/erc-networks-tests.log


Looking at the code, the test creates three buffers, then sorts them by
time. Clock resolution on HPPA appears to be 4 milliseconds, so it is
not unlikely that the buffers end up with exactly the same timestamp and
sorting fails.

Attached patch fixes the problem. Is it OK to install it on the emacs-30
branch?


[-- Attachment #2: 0001-Fix-test-failure-in-erc-networks-tests.patch --]
[-- Type: text/plain, Size: 1120 bytes --]

From bf42248be8e795d591ce97c1d161d73d98038db6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Wed, 4 Sep 2024 13:35:51 +0200
Subject: [PATCH] Fix test failure in erc-networks-tests

* test/lisp/erc/erc-networks-tests.el
(erc-networks--id-sort-buffers): Make sure that buffers have
different timestamps.
---
 test/lisp/erc/erc-networks-tests.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/lisp/erc/erc-networks-tests.el b/test/lisp/erc/erc-networks-tests.el
index f0a7c37ddf2..e84cca68cdd 100644
--- a/test/lisp/erc/erc-networks-tests.el
+++ b/test/lisp/erc/erc-networks-tests.el
@@ -133,10 +133,12 @@ erc-networks--id-sort-buffers
     (with-temp-buffer
       (setq erc-networks--id (erc-networks--id-fixed-create 'oldest)
             oldest (current-buffer))
+      (sleep-for 0.02)
 
       (with-temp-buffer
         (setq erc-networks--id (erc-networks--id-fixed-create 'middle)
               middle (current-buffer))
+        (sleep-for 0.02)
 
         (with-temp-buffer
           (setq erc-networks--id (erc-networks--id-fixed-create 'newest)
-- 
2.46.0


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

* bug#73036: 29.4; Test failure in erc-networks--id-sort-buffers
  2024-09-05  5:59 bug#73036: 29.4; Test failure in erc-networks--id-sort-buffers Ulrich Mueller
@ 2024-09-05  6:44 ` J.P.
       [not found] ` <87bk1261n1.fsf@neverwas.me>
  1 sibling, 0 replies; 3+ messages in thread
From: J.P. @ 2024-09-05  6:44 UTC (permalink / raw)
  To: Ulrich Mueller; +Cc: Eli Zaretskii, emacs-erc, 73036

Hi Ulrich,

Author of shoddy test here. Apologies for the annoyance.

Ulrich Mueller <ulm@gentoo.org> writes:

> Looking at the code, the test creates three buffers, then sorts them by
> time. Clock resolution on HPPA appears to be 4 milliseconds, so it is
> not unlikely that the buffers end up with exactly the same timestamp and
> sorting fails.

Makes sense to me.

> Attached patch fixes the problem. Is it OK to install it on the emacs-30
> branch?

I guess that's up to the Emacs maintainers (Eli Cc'd).

Thanks,
J.P.





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

* bug#73036: 29.4; Test failure in erc-networks--id-sort-buffers
       [not found] ` <87bk1261n1.fsf@neverwas.me>
@ 2024-09-05  8:05   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2024-09-05  8:05 UTC (permalink / raw)
  To: J.P.; +Cc: ulm, emacs-erc, 73036

> From: "J.P." <jp@neverwas.me>
> Cc: 73036@debbugs.gnu.org, emacs-erc@gnu.org, Eli Zaretskii <eliz@gnu.org>
> Date: Wed, 04 Sep 2024 23:44:02 -0700
> 
> Hi Ulrich,
> 
> Author of shoddy test here. Apologies for the annoyance.
> 
> Ulrich Mueller <ulm@gentoo.org> writes:
> 
> > Looking at the code, the test creates three buffers, then sorts them by
> > time. Clock resolution on HPPA appears to be 4 milliseconds, so it is
> > not unlikely that the buffers end up with exactly the same timestamp and
> > sorting fails.
> 
> Makes sense to me.
> 
> > Attached patch fixes the problem. Is it OK to install it on the emacs-30
> > branch?
> 
> I guess that's up to the Emacs maintainers (Eli Cc'd).

It's okay to install these test fixes on the emacs-30 release branch.

Thanks.





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

end of thread, other threads:[~2024-09-05  8:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-05  5:59 bug#73036: 29.4; Test failure in erc-networks--id-sort-buffers Ulrich Mueller
2024-09-05  6:44 ` J.P.
     [not found] ` <87bk1261n1.fsf@neverwas.me>
2024-09-05  8:05   ` Eli Zaretskii

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.