Skip to content

Commit

Permalink
Enabled test_s_random_bytes_is_fork_safe on GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 2, 2024
1 parent 3cf4565 commit bb1c078
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/test_securerandom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def setup
@it = SecureRandom
end

# This test took 2 minutes on my machine.
# And 65536 times loop could not be enough for forcing PID recycle.
if false
# This test took 2 minutes on my machine.
# And 65536 times loop could not be enough for forcing PID recycle.
# We should run this test only on GitHub Actions.
def test_s_random_bytes_is_fork_safe
begin
require 'openssl'
Expand All @@ -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
end if ENV["CI"]

def forking_random_bytes
r, w = IO.pipe
Expand Down Expand Up @@ -60,7 +60,6 @@ def check_forking_random_bytes(target_pid, target)
end
false # not recycled?
end
end

def test_with_openssl
begin
Expand Down

0 comments on commit bb1c078

Please sign in to comment.