Skip to content

Commit 7edb8b3

Browse files
authored
Merge pull request #846 from rhenium/ky/maint-3.1-ci-fixes
Fix CI in maint-3.1 branch
2 parents 82548a4 + befdfb0 commit 7edb8b3

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Gemfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
source "https://rubygems.org"
22

3-
group :development do
4-
gem "rake"
5-
gem "rake-compiler"
6-
gem "test-unit", "~> 3.0", ">= 3.4.6"
7-
end
3+
gem "rake"
4+
gem "rake-compiler"
5+
gem "test-unit", "~> 3.0", ">= 3.4.6"
6+
gem "test-unit-ruby-core"
7+
gem "prime"
8+
gem "rdoc"

test/openssl/test_ossl.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22
require_relative "utils"
33

4-
require 'benchmark'
5-
64
if defined?(OpenSSL)
75

86
class OpenSSL::OSSL < OpenSSL::SSLTestCase
@@ -54,8 +52,14 @@ def test_memcmp_timing
5452

5553
a_b_time = a_c_time = 0
5654
100.times do
57-
a_b_time += Benchmark.measure { 100.times { OpenSSL.fixed_length_secure_compare(a, b) } }.real
58-
a_c_time += Benchmark.measure { 100.times { OpenSSL.fixed_length_secure_compare(a, c) } }.real
55+
t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
56+
100.times { OpenSSL.fixed_length_secure_compare(a, b) }
57+
t2 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
58+
100.times { OpenSSL.fixed_length_secure_compare(a, c) }
59+
t3 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
60+
61+
a_b_time += t2 - t1
62+
a_c_time += t3 - t2
5963
end
6064
assert_operator(a_b_time, :<, a_c_time * 10, "fixed_length_secure_compare timing test failed")
6165
assert_operator(a_c_time, :<, a_b_time * 10, "fixed_length_secure_compare timing test failed")

0 commit comments

Comments
 (0)