Skip to content

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Oct 8, 2025

Deflake IntervalTimerTest tests that relied on old kernel behavior.

This commit fixes two flaky tests in the IntervalTimerTest suite that were
failing on newer Linux kernels (like Linux 6.6.65) due to changes in signal
handling logic. It passes on at least Linux 5.10.0.

RealTimeSignalsAreNotDuplicated: This test was failing because it assumed that
disarming a timer (calling timer_settime with a zero interval) would leave one
pending signal but reset the si_overrun count. On newer kernels, this action
appears to clear both the pending signal and the overrun count, causing the
initial sigtimedwait() to fail with EAGAIN. The relevant Linux commit seems to
be 513793bc6ab3 ("posix-timers: Make signal delivery consistent"). Fixed it by
calling sigtimedwait() before disarming the timer.

IgnoredSignalCountsAsOverrun: This test was also failing with EAGAIN. Its
logic was based on the premise that a blocked signal with a SIG_IGN disposition
would be queued, allowing sigtimedwait to retrieve it and check its overrun
count. This premise is no longer valid on modern kernels. It seems like newer
kernels now discard SIG_IGN immediately on generation, regardless of whether
the signal is blocked or not. The signal never becomes pending, so sigtimedwait
will always fail. The relevant Linux commit seems to be df7a996b4dab ("signal:
Queue ignored posixtimers on ignore list"). Just deleted this test.

@copybara-service copybara-service bot added the exported Issue was exported automatically label Oct 8, 2025
@copybara-service copybara-service bot force-pushed the test/cl808421309 branch 2 times, most recently from d29c714 to ca8337c Compare October 8, 2025 21:56
This commit fixes two flaky tests in the IntervalTimerTest suite that were
failing on newer Linux kernels (like Linux 6.6.65) due to changes in signal
handling logic. It passes on at least Linux 5.10.0.

RealTimeSignalsAreNotDuplicated: This test was failing because it assumed that
disarming a timer (calling timer_settime with a zero interval) would leave one
pending signal but reset the si_overrun count. On newer kernels, this action
appears to clear both the pending signal and the overrun count, causing the
initial sigtimedwait() to fail with EAGAIN. The relevant Linux commit seems to
be 513793bc6ab3 ("posix-timers: Make signal delivery consistent"). Fixed it by
calling sigtimedwait() before disarming the timer.

IgnoredSignalCountsAsOverrun: This test was also failing with EAGAIN. Its
logic was based on the premise that a blocked signal with a SIG_IGN disposition
would be queued, allowing sigtimedwait to retrieve it and check its overrun
count. This premise is no longer valid on modern kernels. It seems like newer
kernels now discard SIG_IGN immediately on generation, regardless of whether
the signal is blocked or not. The signal never becomes pending, so sigtimedwait
will always fail. The relevant Linux commit seems to be df7a996b4dab ("signal:
Queue ignored posixtimers on ignore list"). Just deleted this test.
PiperOrigin-RevId: 816883590
@copybara-service copybara-service bot merged commit 0799336 into master Oct 8, 2025
@copybara-service copybara-service bot deleted the test/cl808421309 branch October 8, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant