diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-01-12 18:20:25 +0900 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-01-12 20:02:50 +0900 |
| commit | 3103ed4159240e99614c9789bc0f869574a1f9db (patch) | |
| tree | 11b5fed86b3c1483e1fe349d6f3a6a20c24c9f02 | |
| parent | 80feecd6a36ec640f2fab212a015281e920dc092 (diff) | |
Use timeout instead of sleep on Windows
| -rw-r--r-- | spec/ruby/core/process/waitpid_spec.rb | 3 |
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) |
