Subject: bug#45818: closed (Re: bug#45818: 28.0.50; Test solar-sunrise-sunset fails)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 12 Jan 2021 21:04:02 +0000

Your bug report

#45818: 28.0.50; Test solar-sunrise-sunset fails

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
45818: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=45818
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#45818: 28.0.50; Test solar-sunrise-sunset fails
From: Mattias Engdegård <[email-masked]>
To: "Basil L. Contovounesios" <[email-masked]>
Cc: [email-masked]
Date: Tue, 12 Jan 2021 22:02:15 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

12 jan. 2021 kl. 21.06 skrev Basil L. Contovounesios <[email-masked]>:

> So I'm guessing dst-adjust-time adjusts for DST in my locale (based on
> some cache), but not yours?  The following change lets the test succeed
> for me:

Thank you, and I agree that it's probably the pragmatic choice. Much as I would have liked to track down and explain the exact reason for the observed phenomenon, I gave up and pushed your suggested patch.

If I would hazard a guess, it's related to the fact that Ireland uses daylight saving in winter (with opposite adjustment) rather than in summer; this may trigger a daylight-saving adjustment for the dates in question (late December). The fact that IST is used for both Irish and Indian time may be significant or a mere coincidence; it certainly didn't help matters.

Date and time calculations can be both infuriatingly and delightfully messy, but in this case the code didn't really help either, with way too many implicit input parameters -- global variables, caches, system settings, time-zone files, and so on. Not something to make a test writer happy!

Thanks again for the report, and for persevering!

Subject: 28.0.50; Test solar-sunrise-sunset fails
From: "Basil L. Contovounesios" <[email-masked]>
To: [email-masked]
Date: Tue, 12 Jan 2021 16:28:22 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

X-Debbugs-Cc: Mattias Engdegård <[email-masked]>

The following test has been failing for me, probably since it was
introduced:

--8<---------------cut here---------------start------------->8---
Running 1 tests (2021-01-12 15:11:42+0000, selector ‘(not (or (tag :expensive-test) (tag :unstable)))’)
Test solar-sunrise-sunset backtrace:
  signal(ert-test-failed (((should (< (abs (- sunrise 7.27)) epsilon))
  ert-fail(((should (< (abs (- sunrise 7.27)) epsilon)) :form (< 1.003
  #f(compiled-function () #<bytecode 0x121b36c341caac2>)()
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name solar-sunrise-sunset :documentation n
  ert-run-or-rerun-test(#s(ert--stats :selector (not (or (tag :expensi
  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" "-l" "lisp/calendar/solar-tests
  command-line()
  normal-top-level()
Test solar-sunrise-sunset condition:
    (ert-test-failed
     ((should
       (<
	(abs ...)
	epsilon))
      :form
      (< 1.0033333324640985 0.016666666666666666)
      :value nil))
   FAILED  1/1  solar-sunrise-sunset (0.001369 sec)

Ran 1 tests, 0 results as expected, 1 unexpected (2021-01-12 15:11:42+0000, 0.071452 sec)

1 unexpected results:
   FAILED  solar-sunrise-sunset
--8<---------------cut here---------------end--------------->8---

The failure corresponds to the following line in the test:

  (should (< (abs (- sunrise 7.27)) epsilon))

At that point, sunrise-sunset has the following value:

  ((6.266666667535901 #1="IST") (16.716666667722166 #1#) "10:26")

In case it matters, my time zone is currently GMT +0000, and IST can
also refer to Irish Standard Time here.  I tried binding
calendar-{standard,daylight}-time-zone-name to "+0530" in the test, but
that didn't change anything.  Any ideas?

Thanks,

-- 
Basil

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-01-12 built on tia
Repository revision: ca024b0575c4ea754c4c6e6dbf21ed610e0d1fb8
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --enable-checking=structs
 --with-x-toolkit=lucid --with-file-notification=yes --with-x'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11
XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml easymenu mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit x multi-tty make-network-process emacs)