ruby-changes:54428
From: eregon <ko1@a...>
Date: Sun, 30 Dec 2018 06:55:39 +0900 (JST)
Subject: [ruby-changes:54428] eregon:r66641 (trunk): Exclude CLOCKs which require special permissions in Process.clock_gettime specs
eregon 2018-12-30 06:54:45 +0900 (Sun, 30 Dec 2018) New Revision: 66641 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66641 Log: 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 Modified files: trunk/spec/ruby/core/process/clock_gettime_spec.rb Index: spec/ruby/core/process/clock_gettime_spec.rb =================================================================== --- spec/ruby/core/process/clock_gettime_spec.rb (revision 66640) +++ spec/ruby/core/process/clock_gettime_spec.rb (revision 66641) @@ -1,11 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/clock_gettime_spec.rb#L1 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/