Skip to content

FIX: skip perform_microtask_checkpoint tests on TruffleRuby (they hang CI)#427

Open
ursm wants to merge 1 commit into
rubyjs:mainfrom
ursm:fix/truffleruby-microtask-checkpoint-skip
Open

FIX: skip perform_microtask_checkpoint tests on TruffleRuby (they hang CI)#427
ursm wants to merge 1 commit into
rubyjs:mainfrom
ursm:fix/truffleruby-microtask-checkpoint-skip

Conversation

@ursm
Copy link
Copy Markdown
Contributor

@ursm ursm commented Jun 3, 2026

Problem

The truffleruby+graalvm CI jobs (ubuntu + macOS) have been red: the job exceeds its timeout-minutes: 10 with no test output (the graal.js stdout is buffered, so the CI log just shows # Running: and then nothing until the runner is killed).

Root cause

Context#perform_microtask_checkpoint is a V8-only API — the TruffleRuby backend (lib/mini_racer/truffleruby.rb) does not implement it. The two tests added with that feature call it without a TruffleRuby guard:

  • test_perform_microtask_checkpoint_returns_nil
  • test_perform_microtask_checkpoint_drains_from_callback

The second invokes perform_microtask_checkpoint from inside a JS→Ruby callback (drain()), which hangs the TruffleRuby graal.js context indefinitely. That single hang trips the 10-minute job timeout and takes the whole suite red.

Fix

Skip both tests on TruffleRuby, matching the convention already used by other V8-only tests in this file (max_memory, webassembly, …).

Verification

Reproduced locally with truffleruby+graalvm-34.0.1:

  • Before: bundle exec rake test hangs at test_perform_microtask_checkpoint_drains_from_callback (never completes).
  • After: the suite completes — 113 runs, 0 failures, 0 errors, 34 skips.

Note (out of scope)

A separate failure exists on the linux-ubuntu-24.04-arm - ruby-3.3 - musl job: test_forking intermittently fails (the test/test_forking.rb child, exercising single_threaded + fork + GC, crashes). It is flaky — it passed in some runs and failed in others on identical code, and could not be reproduced in 20+ runs under a faithful aarch64-linux-musl container. This PR does not address it.

🤖 Generated with Claude Code

perform_microtask_checkpoint is a V8-only API (the TruffleRuby backend does
not implement it). The two tests added in rubyjs#418 call it without a TruffleRuby
guard; test_perform_microtask_checkpoint_drains_from_callback invokes it from
inside a JS->Ruby callback, which hangs the TruffleRuby graal.js context
indefinitely and makes the truffleruby CI job exceed its 10-minute timeout
(taking the whole suite red). Skip both on TruffleRuby, matching the
convention used by other V8-only tests (max_memory, webassembly, ...).

Verified locally with truffleruby+graalvm-34.0.1: the suite now completes
(113 runs, 0 failures, 34 skips) instead of hanging.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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