Skip the entire Process.clock_getres spec on FreeBSD
* Clocks don't match the reported precision. * https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/log/20190428T093003Z.fail.html.gz
This commit is contained in:
parent
f40458e9dd
commit
5d24fba544
@ -2,6 +2,7 @@ require_relative '../../spec_helper'
|
|||||||
require_relative 'fixtures/clocks'
|
require_relative 'fixtures/clocks'
|
||||||
|
|
||||||
describe "Process.clock_getres" do
|
describe "Process.clock_getres" do
|
||||||
|
platform_is_not :freebsd do # clock_getres() seems incorrect on FreeBSD
|
||||||
ProcessSpecs.clock_constants.each do |name, value|
|
ProcessSpecs.clock_constants.each do |name, value|
|
||||||
it "matches the clock in practice for Process::#{name}" do
|
it "matches the clock in practice for Process::#{name}" do
|
||||||
times = []
|
times = []
|
||||||
@ -10,11 +11,9 @@ describe "Process.clock_getres" do
|
|||||||
end
|
end
|
||||||
reported = Process.clock_getres(value, :nanosecond)
|
reported = Process.clock_getres(value, :nanosecond)
|
||||||
|
|
||||||
platform_is_not :bsd do
|
|
||||||
# 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
|
||||||
end
|
|
||||||
|
|
||||||
# We're assuming precision is a multiple of ten - it may or may not
|
# We're assuming precision is a multiple of ten - it may or may not
|
||||||
# be an incompatibility if it isn't but we'd like to notice this,
|
# be an incompatibility if it isn't but we'd like to notice this,
|
||||||
@ -28,6 +27,7 @@ describe "Process.clock_getres" do
|
|||||||
times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.size
|
times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.size
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# These are documented
|
# These are documented
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user