From 35f972da5eb1c94c3e7e7d98faf05f105a10b5e8 Mon Sep 17 00:00:00 2001 From: Sampo Kuokkanen Date: Fri, 30 Oct 2026 19:33:56 +0900 Subject: [PATCH] Skip fork and missing-command tests where they cannot run. The fork tests now skip unless `Process.respond_to?(:fork)`, which is false on JRuby and Windows. On JRuby the fork call raised NotImplementedError, a ScriptError, which ended the whole sus run. JRuby does not spawn a process for a missing command, so `system("does-not-exist")` never reaches `process_wait`. --- test/kernel.rb | 2 ++ test/process/fork.rb | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/test/kernel.rb b/test/kernel.rb index 73996897..4ef1e94d 100644 --- a/test/kernel.rb +++ b/test/kernel.rb @@ -36,6 +36,8 @@ end it "can fail to execute child process" do + skip "JRuby does not spawn a missing command, so there is no process to wait for" if RUBY_ENGINE == "jruby" + expect(reactor).to receive(:process_wait) result = ::Kernel.system("does-not-exist") diff --git a/test/process/fork.rb b/test/process/fork.rb index 5f67d490..c6e3429f 100644 --- a/test/process/fork.rb +++ b/test/process/fork.rb @@ -10,6 +10,8 @@ describe Process do describe ".fork" do it "can fork with block form" do + skip "Process.fork is not supported!" unless Process.respond_to?(:fork) + r, w = IO.pipe Async do @@ -27,6 +29,8 @@ end it "can fork with non-block form" do + skip "Process.fork is not supported!" unless Process.respond_to?(:fork) + r, w = IO.pipe Async do @@ -46,6 +50,8 @@ end it "can fork while another fiber is blocked" do + skip "Process.fork is not supported!" unless Process.respond_to?(:fork) + r, w = IO.pipe queue = Thread::Queue.new