summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2024-12-02 12:57:11 +0900
committerHiroshi SHIBATA <[email protected]>2024-12-02 15:32:05 +0900
commit587bd583cc6f2ad799b420823c60427196c39c1b (patch)
treeef931a71c637fb71fcc39e9489eefdeab808d5fc /test
parent983ae63f5912204f88e61bf8dd9c0d7c1d009503 (diff)
[ruby/securerandom] Enabled test_s_random_bytes_is_fork_safe with Apple Silicon and expand running times
https://github.com/ruby/securerandom/commit/40ddef8a83
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12231
Diffstat (limited to 'test')
-rw-r--r--test/test_securerandom.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_securerandom.rb b/test/test_securerandom.rb
index e2bdf26757..a3761da4f2 100644
--- a/test/test_securerandom.rb
+++ b/test/test_securerandom.rb
@@ -21,7 +21,7 @@ class TestSecureRandom < Test::Unit::TestCase
SecureRandom.random_bytes(8)
pid, v1 = forking_random_bytes
assert(check_forking_random_bytes(pid, v1), 'Process ID not recycled?')
- end if ENV["CI"]
+ end if ENV["CI"] && RUBY_PLATFORM =~ /darwin/ && `sw_vers -productVersion`.to_i > 13 # for Apple Silicon
def forking_random_bytes
r, w = IO.pipe
@@ -38,7 +38,7 @@ class TestSecureRandom < Test::Unit::TestCase
end
def check_forking_random_bytes(target_pid, target)
- 65536.times do
+ (65536 * 1.5).to_i.times do
pid = fork {
if $$ == target_pid
v2 = SecureRandom.random_bytes(8)