Skip to content

Commit 94f8bc9

Browse files
committed
[ruby/securerandom] Enabled test_s_random_bytes_is_fork_safe on GitHub Actions
ruby/securerandom@bb1c078e9f
1 parent eb0442a commit 94f8bc9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/test_securerandom.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def setup
99
@it = SecureRandom
1010
end
1111

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

2626
def forking_random_bytes
2727
r, w = IO.pipe
@@ -60,7 +60,6 @@ def check_forking_random_bytes(target_pid, target)
6060
end
6161
false # not recycled?
6262
end
63-
end
6463

6564
def test_with_openssl
6665
begin

0 commit comments

Comments
 (0)