ruby-changes:59005
From: Takashi <ko1@a...>
Date: Sun, 1 Dec 2019 06:30:50 +0900 (JST)
Subject: [ruby-changes:59005] 5b1f7f26b4 (master): Skip if getrusage is not supported
https://git.ruby-lang.org/ruby.git/commit/?id=5b1f7f26b4 From 5b1f7f26b4ff3b05e1c184ae87154a323b1be915 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sat, 30 Nov 2019 13:29:00 -0800 Subject: Skip if getrusage is not supported 1243255c3a36433041012b6107a5ac48658a0895 broke ci.rvm.jp tests like http://ci.rvm.jp/results/trunk_clang_39@silicon-docker/2445098. 253232c028a5565dbeecc05fab5e81b35ab58bcc works only if getrusage is supported. diff --git a/spec/ruby/core/process/times_spec.rb b/spec/ruby/core/process/times_spec.rb index f148954..32a5666 100644 --- a/spec/ruby/core/process/times_spec.rb +++ b/spec/ruby/core/process/times_spec.rb @@ -16,6 +16,11 @@ describe "Process.times" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/times_spec.rb#L16 ruby_version_is "2.5" do platform_is_not :windows do it "uses getrusage when available to improve precision beyond milliseconds" do + times = 100.times.map { Process.clock_gettime(:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID) } + if times.count { |t| ((t * 1e6).to_i % 1000) > 0 } == 0 + skip "getrusage is not supported on this environment" + end + times = 100.times.map { Process.times } times.count { |t| ((t.utime * 1e6).to_i % 1000) > 0 }.should > 0 times.count { |t| ((t.stime * 1e6).to_i % 1000) > 0 }.should > 0 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/