mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Workaround a CentOS bug in Process.clock_getres specs
This commit is contained in:
parent
14965c5f4b
commit
13abf5519a
1 changed files with 16 additions and 12 deletions
|
@ -11,6 +11,9 @@ describe "Process.clock_getres" do
|
||||||
end
|
end
|
||||||
reported = Process.clock_getres(value, :nanosecond)
|
reported = Process.clock_getres(value, :nanosecond)
|
||||||
|
|
||||||
|
# CentOS seems to report a negative resolution:
|
||||||
|
# https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos6/ruby-trunk/log/20190428T093004Z.fail.html.gz
|
||||||
|
unless name == :CLOCK_MONOTONIC_RAW and reported < 0
|
||||||
# The clock should not be more accurate than reported (times should be
|
# The clock should not be more accurate than reported (times should be
|
||||||
# a multiple of reported precision.)
|
# a multiple of reported precision.)
|
||||||
times.select { |t| t % reported > 0 }.should be_empty
|
times.select { |t| t % reported > 0 }.should be_empty
|
||||||
|
@ -28,6 +31,7 @@ describe "Process.clock_getres" do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# These are documented
|
# These are documented
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue