Skip to content

🐛 fix(test): yield with sleep(0.0) on GraalPy - #939

Merged
gaborbernat merged 2 commits into
mainfrom
fix/graal-sleep-zero
Nov 16, 2026
Merged

gaborbernat merged 2 commits into
mainfrom
fix/graal-sleep-zero

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

The weekly GraalPy job ran past its timeout, because the threaded lock tests yield the GIL with time.sleep(0). On GraalPy 25.4.4 an int 0 can sleep up to a second, while 0.0 returns at once (int path rounds the deadline down to the whole second and loops until that second ends), and the 2026-11-09 weekly job was cancelled at its 60 minute limit.

🧪 The workflow comment no longer blames a whole-runtime freeze; the job keeps its weekly schedule and stays off pull requests.

On GraalPy 25.4.4, time.sleep(0) with an int sleeps up to a second,
while time.sleep(0.0) returns at once. The GIL yields in the threaded
lock tests therefore cost a second each, and the weekly GraalPy job
ran past its timeout. Pass a float at the three yield points.
The comment blamed a freeze under the threaded lock tests. The stall is
the one-second int sleep fixed in the previous commit.
@gaborbernat gaborbernat added the skip news Internal change; exempt from the news fragment check label Nov 16, 2026
@gaborbernat
gaborbernat merged commit ecc7f07 into main Nov 16, 2026
50 checks passed
@gaborbernat
gaborbernat deleted the fix/graal-sleep-zero branch November 16, 2026 16:05
gaborbernat added a commit that referenced this pull request Nov 16, 2026
This fixes the 14 GraalPy 25.4.4 failures left in the weekly job after
#939. The job goes green only with #939 and this PR both merged: #939
removes the threaded timeout, and this PR fixes the remaining failures.

Root causes:

- **`os.pwrite` missing (8 tests).** Releasing a soft lock whose marker
a peer replaced rewrote the record with `os.pwrite`. GraalPy 25.4.4 has
no `os.pwrite`, so release raised `AttributeError` instead of returning.
`write_at_start` rewinds the descriptor and writes where `pwrite` is
absent. This is a library fix.
- **Owner recheck skipped (4 recheck tests and
`test_live_lock_refuses_a_tree_another_account_planted_after_a_recovery`).**
GraalPy has no `os.link` with `dir_fd`, so the soft read-write storage
uses protocol directories by name. On POSIX nothing is pinned in that
mode, so the sticky-parent owner check made at `prepare()` never ran
again. Each call now checks the owner of what the names resolve to. This
is a library fix that also applies to any other POSIX platform without
that `dir_fd` support.
- **`gc.get_objects` missing (1 test).** The async give-up test counts
live futures, which needs `gc.get_objects`. It is gated on a new
`gc-objects` capability, like the other runtime differences.

Verification:

- GraalPy 3.13 (25.4.4), full suite, on this PR plus #939: 2689 passed,
357 skipped, no failures and no timeouts. Before, the same suite had 14
failures and aborted on the threaded timeout.
- CPython 3.15: 2933 passed, 113 skipped. Coverage is 99.99%. The only
missing lines are `tests/test_soft_stale.py:1189-1192`, an AF_UNIX test
that skips when the temp path is too long for a socket. It skips here
only because this checkout's temp directory path is long.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug skip news Internal change; exempt from the news fragment check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant