summaryrefslogtreecommitdiff
path: root/spec/ruby/core
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-29 21:54:45 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-29 21:54:45 +0000
commitbe8d3ed1fd2f8eb8ec5918c0a7ec30afc4fb34d4 (patch)
tree9b0bd4b62bf52870738f11925664b2d38b8ee993 /spec/ruby/core
parent94f4a0e91ee7077bcb4391a6f754c6ec58e78a15 (diff)
Exclude CLOCKs which require special permissions in Process.clock_gettime specs
* https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-ad7f67/ruby-trunk/log/20181229T135406Z.fail.html.gz * https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-trunk/log/20181229T143303Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core')
-rw-r--r--spec/ruby/core/process/clock_gettime_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/ruby/core/process/clock_gettime_spec.rb b/spec/ruby/core/process/clock_gettime_spec.rb
index 70ec2c4bb5..a7b6bd2b02 100644
--- a/spec/ruby/core/process/clock_gettime_spec.rb
+++ b/spec/ruby/core/process/clock_gettime_spec.rb
@@ -1,11 +1,14 @@
require_relative '../../spec_helper'
describe "Process.clock_gettime" do
- # This does not succeed with some platforms:
- # RHEL: https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-trunk/log/20181229T063303Z.fail.html.gz
- # Solaris: https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20181229T002409Z.fail.html.gz
platform_is_not :windows, :solaris do
- Process.constants.select { |c| c.to_s.start_with?('CLOCK_') }.each do |c|
+ Process.constants.select { |c|
+ c.to_s.start_with?('CLOCK_') &&
+ # These require CAP_WAKE_ALARM and are not documented in clock_gettime(),
+ # they return EINVAL if the permission is not granted.
+ c != :CLOCK_BOOTTIME_ALARM &&
+ c != :CLOCK_REALTIME_ALARM
+ }.each do |c|
it "can be called with Process::#{c}" do
value = Process.const_get(c)
Process.clock_gettime(value).should be_an_instance_of(Float)