summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-05-20 10:40:34 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-05-20 10:41:40 +0200
commit2a34543e11299146db688e636e0b95c22990e302 (patch)
tree09c702c067af3bdb2519e95d0818a15e985fd440 /spec/ruby
parentab0f2deab11a3203f9af3af1a27dfea1f4a882f3 (diff)
Move exclusion for Hyper-V next to other skipped constants
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/process/clock_getres_spec.rb7
-rw-r--r--spec/ruby/core/process/fixtures/clocks.rb8
2 files changed, 9 insertions, 6 deletions
diff --git a/spec/ruby/core/process/clock_getres_spec.rb b/spec/ruby/core/process/clock_getres_spec.rb
index d95272f6c7..0fc2a958b3 100644
--- a/spec/ruby/core/process/clock_getres_spec.rb
+++ b/spec/ruby/core/process/clock_getres_spec.rb
@@ -24,12 +24,7 @@ describe "Process.clock_getres" do
# The clock should not be less accurate than reported (times should
# not all be a multiple of the next precision up, assuming precisions
# are multiples of ten.)
-
- if name != :CLOCK_MONOTONIC_RAW
- # On a Hyper-V Linux guest machine, CLOCK_MONOTONIC_RAW can violate
- # this assertion. So skipping this test for CLOCK_MONOTONIC_RAW.
- times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.size
- end
+ times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.size
end
end
end
diff --git a/spec/ruby/core/process/fixtures/clocks.rb b/spec/ruby/core/process/fixtures/clocks.rb
index f59a9562ec..cd75b8a772 100644
--- a/spec/ruby/core/process/fixtures/clocks.rb
+++ b/spec/ruby/core/process/fixtures/clocks.rb
@@ -47,6 +47,14 @@ module ProcessSpecs
}
end
+ # On a Hyper-V Linux guest machine, these clocks in practice
+ # seem to be less precise than advertised by clock_getres
+ platform_is :linux do
+ clocks = clocks.reject { |clock, value|
+ clock == :CLOCK_MONOTONIC_RAW
+ }
+ end
+
clocks
end
end