summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-01-12 18:20:25 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-01-12 20:02:50 +0900
commit3103ed4159240e99614c9789bc0f869574a1f9db (patch)
tree11b5fed86b3c1483e1fe349d6f3a6a20c24c9f02
parent80feecd6a36ec640f2fab212a015281e920dc092 (diff)
Use timeout instead of sleep on Windows
-rw-r--r--spec/ruby/core/process/waitpid_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/ruby/core/process/waitpid_spec.rb b/spec/ruby/core/process/waitpid_spec.rb
index f7cf1a45a8..a02147b663 100644
--- a/spec/ruby/core/process/waitpid_spec.rb
+++ b/spec/ruby/core/process/waitpid_spec.rb
@@ -2,7 +2,8 @@ require_relative '../../spec_helper'
describe "Process.waitpid" do
it "returns nil when the process has not yet completed and WNOHANG is specified" do
- pid = spawn("sleep 5")
+ cmd = platform_is(:windows) ? "timeout" : "sleep"
+ pid = spawn("#{cmd} 5")
begin
Process.waitpid(pid, Process::WNOHANG).should == nil
Process.kill("KILL", pid)