Subject: Re: bug#55628: debug-timer-check fails on macOS 11.6.6

From: Eli Zaretskii <[email-masked]>
Date: Wed, 25 May 2022 20:11:16 +0300

> Resent-From: Mattias Engdegård <[email-masked]>
> Original-Sender: "Debbugs-submit" <[email-masked]>
> Resent-CC: [email-masked]
> Resent-Sender: [email-masked]
> Cc: [email-masked]
> From: Mattias Engdegård <[email-masked]>
> Date: Wed, 25 May 2022 17:34:57 +0200
> 
> 25 maj 2022 kl. 15.05 skrev Mattias Engdegård <[email-masked]>:
> 
> > More digging shows that set_alarm always sets the interval timer to at least 1 ms in the future even if the timer has expired.
> 
> In fact it was even worse than that: because of a second bug, the timer was then immediately reset to at least 1 s in the future. The proposed patch fixes both flaws.

Btw, this test will never work on a platform that only has setitimer,
because only one ITIMER_REAL timer is guaranteed to exist, and the
function attempts to arm 10 timers at the same time.

> Good to have a test for it -- maybe it should always be enabled, not just with enable-checking? People don't always reconfigure, rebuild and re-run the tests with enable-checking, nor do any of the build bots.

We don't usually have testing code in a production build, so why make
an exception here?  Especially since atimers are an obscure feature
used internally by Emacs.