mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Skip problematic Process.clock_getres specs on ARM
* https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-trunk/log/20190428T051708Z.fail.html.gz * https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-ad7f67/ruby-trunk/log/20190428T045405Z.fail.html.gz
This commit is contained in:
parent
cb8eb37377
commit
9a0dbb3414
2 changed files with 19 additions and 5 deletions
|
@ -3,7 +3,7 @@ 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
|
platform_is_not :freebsd do # clock_getres() seems incorrect on FreeBSD
|
||||||
ProcessSpecs.clock_constants.each do |name, value|
|
ProcessSpecs.clock_constants_for_resolution_checks.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_000.times do
|
10_000.times do
|
||||||
|
|
|
@ -9,14 +9,28 @@ module ProcessSpecs
|
||||||
# Process#clock_gettime. They return EINVAL if the permission
|
# Process#clock_gettime. They return EINVAL if the permission
|
||||||
# is not granted.
|
# is not granted.
|
||||||
clocks -= [:CLOCK_BOOTTIME_ALARM, :CLOCK_REALTIME_ALARM]
|
clocks -= [:CLOCK_BOOTTIME_ALARM, :CLOCK_REALTIME_ALARM]
|
||||||
|
|
||||||
# These clocks in practice on Linux do not seem to match
|
|
||||||
# their reported resolution.
|
|
||||||
clocks -= [:CLOCK_REALTIME_COARSE, :CLOCK_MONOTONIC_COARSE]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
clocks.map { |c|
|
clocks.map { |c|
|
||||||
[c, Process.const_get(c)]
|
[c, Process.const_get(c)]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.clock_constants_for_resolution_checks
|
||||||
|
clocks = clock_constants
|
||||||
|
|
||||||
|
# These clocks in practice on Linux do not seem to match their reported resolution.
|
||||||
|
clocks = clocks.reject { |clock, value|
|
||||||
|
[:CLOCK_REALTIME_COARSE, :CLOCK_MONOTONIC_COARSE].include?(clock)
|
||||||
|
}
|
||||||
|
|
||||||
|
# These clocks in practice on ARM on Linux do not seem to match their reported resolution.
|
||||||
|
platform_is :armv7l, :aarch64 do
|
||||||
|
clocks = clocks.reject { |clock, value|
|
||||||
|
[:CLOCK_PROCESS_CPUTIME_ID, :CLOCK_THREAD_CPUTIME_ID, :CLOCK_MONOTONIC_RAW].include?(clock)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
clocks
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue