Skip to content

Commit 587bd58

Browse files
committed
[ruby/securerandom] Enabled test_s_random_bytes_is_fork_safe with Apple Silicon and expand running times
ruby/securerandom@40ddef8a83
1 parent 983ae63 commit 587bd58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_securerandom.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_s_random_bytes_is_fork_safe
2121
SecureRandom.random_bytes(8)
2222
pid, v1 = forking_random_bytes
2323
assert(check_forking_random_bytes(pid, v1), 'Process ID not recycled?')
24-
end if ENV["CI"]
24+
end if ENV["CI"] && RUBY_PLATFORM =~ /darwin/ && `sw_vers -productVersion`.to_i > 13 # for Apple Silicon
2525

2626
def forking_random_bytes
2727
r, w = IO.pipe
@@ -38,7 +38,7 @@ def forking_random_bytes
3838
end
3939

4040
def check_forking_random_bytes(target_pid, target)
41-
65536.times do
41+
(65536 * 1.5).to_i.times do
4242
pid = fork {
4343
if $$ == target_pid
4444
v2 = SecureRandom.random_bytes(8)

0 commit comments

Comments
 (0)