summaryrefslogtreecommitdiff
path: root/spec/ruby/core/process
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-04-28 14:52:55 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-04-28 14:55:30 +0200
commit9a0dbb341442fc0d203a5cd6fb46250e429e9188 (patch)
tree0b01ca08cb7de600c5922a479e36ac831146200f /spec/ruby/core/process
parentcb8eb37377289a3874742af290bcd32dd09910bf (diff)
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
Diffstat (limited to 'spec/ruby/core/process')
-rw-r--r--spec/ruby/core/process/clock_getres_spec.rb2
-rw-r--r--spec/ruby/core/process/fixtures/clocks.rb22
2 files changed, 19 insertions, 5 deletions
diff --git a/spec/ruby/core/process/clock_getres_spec.rb b/spec/ruby/core/process/clock_getres_spec.rb
index 5e5eb0246c..3ebd012ffe 100644
--- a/spec/ruby/core/process/clock_getres_spec.rb
+++ b/spec/ruby/core/process/clock_getres_spec.rb
@@ -3,7 +3,7 @@ require_relative 'fixtures/clocks'
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_for_resolution_checks.each do |name, value|
it "matches the clock in practice for Process::#{name}" do
times = []
10_000.times do
diff --git a/spec/ruby/core/process/fixtures/clocks.rb b/spec/ruby/core/process/fixtures/clocks.rb
index 5d6edebfc9..c8f81fa4c3 100644
--- a/spec/ruby/core/process/fixtures/clocks.rb
+++ b/spec/ruby/core/process/fixtures/clocks.rb
@@ -9,14 +9,28 @@ module ProcessSpecs
# Process#clock_gettime. They return EINVAL if the permission
# is not granted.
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
clocks.map { |c|
[c, Process.const_get(c)]
}
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