Skip to content

test_signal.test_itimer_virtual times out on macOS #130917

@diegorusso

Description

@diegorusso

Bug report

Bug description:

The test test_signal.test_itimer_virtual fails (in TIMEOUT) on our internal CI mac infrastructure (and also on my mac used for development)

[2025-03-06T12:21:58.340Z] Re-running test_signal in verbose mode (matching: test_itimer_virtual)
[2025-03-06T12:21:58.340Z] test_itimer_virtual (test.test_signal.ItimerTest.test_itimer_virtual) ... FAIL
[2025-03-06T12:21:58.340Z] 
[2025-03-06T12:21:58.340Z] ======================================================================
[2025-03-06T12:21:58.340Z] FAIL: test_itimer_virtual (test.test_signal.ItimerTest.test_itimer_virtual)
[2025-03-06T12:21:58.340Z] ----------------------------------------------------------------------
[2025-03-06T12:21:58.340Z] Traceback (most recent call last):
[2025-03-06T12:21:58.340Z]   File "/Users/bot/workspace/workspace/enterprise-llt-gerrit-pipeline/src/cpython/Lib/test/test_signal.py", line 843, in test_itimer_virtual
[2025-03-06T12:21:58.340Z]     for _ in support.busy_retry(support.LONG_TIMEOUT):
[2025-03-06T12:21:58.340Z]              ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
[2025-03-06T12:21:58.340Z]   File "/Users/bot/workspace/workspace/enterprise-llt-gerrit-pipeline/src/cpython/Lib/test/support/__init__.py", line 2544, in busy_retry
[2025-03-06T12:21:58.340Z]     raise AssertionError(msg)
[2025-03-06T12:21:58.340Z] AssertionError: timeout (300.0 seconds)
[2025-03-06T12:21:58.340Z] 
[2025-03-06T12:21:58.340Z] ----------------------------------------------------------------------
[2025-03-06T12:21:58.340Z] Ran 1 test in 300.002s

The timer doesn't get stopped by the signal. This if statement

if signal.getitimer(self.itimer) == (0.0, 0.0):
is never True and it goes in timeout.

_ = pow(12345, 67890, 10000019)

The reason behind this is the workload simulated is too lightweight to advance the virtual timer.

I see for now this just on macOS but it could potentially happens on other platforms as well.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions