Skip to content

Commit

Permalink
[ruby/securerandom] Enabled test_s_random_bytes_is_fork_safe with App…
Browse files Browse the repository at this point in the history
…le Silicon and expand running times

ruby/securerandom@40ddef8a83
  • Loading branch information
hsbt committed Dec 2, 2024
1 parent c0e0335 commit 4e9d566
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_securerandom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_s_random_bytes_is_fork_safe
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
Expand All @@ -38,7 +38,7 @@ def forking_random_bytes
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)
Expand Down

0 comments on commit 4e9d566

Please sign in to comment.