Skip to content

test: make test_omp_get_wtime deterministic - #77

Merged
ggeorgakoudis merged 1 commit into
mainfrom
fix-flaky-omp-get-wtime-test
Sep 27, 2026
Merged

ggeorgakoudis merged 1 commit into
mainfrom
fix-flaky-omp-get-wtime-test

Conversation

@ggeorgakoudis

Copy link
Copy Markdown
Contributor

test_omp_get_wtime busy-waited for 0.25 s. It then asserted the elapsed time with assertAlmostEqual(delay, t, places=2), which allows only 5 ms of error. The loop cannot exit early, so the only possible error is overshoot. On shared CI runners, the process can be descheduled for more than 5 ms near the deadline. This made the macOS job fail intermittently.

The test no longer measures time. It now checks that omp_get_wtime can be called from njit code and from interpreted Python, and that each call returns a positive float.

The busy-wait asserted elapsed time within 5 ms (places=2). CI
runner preemption past the deadline failed the macOS job
intermittently.

Timing accuracy belongs to libomp, not PyOMP. Keep binding coverage:
omp_get_wtime is the only float64-returning _OpenmpExternalFunction,
so the test checks a positive float from both njit and interpreted
calls.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ggeorgakoudis
ggeorgakoudis merged commit 473dcf5 into main Sep 27, 2026
131 checks passed
@ggeorgakoudis
ggeorgakoudis deleted the fix-flaky-omp-get-wtime-test branch September 27, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant