mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Skip if getrusage is not supported
1243255c3a
broke ci.rvm.jp tests like http://ci.rvm.jp/results/trunk_clang_39@silicon-docker/2445098.253232c028
works only if getrusage is supported.
This commit is contained in:
parent
1243255c3a
commit
5b1f7f26b4
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,11 @@ describe "Process.times" do
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue