summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2024-12-02 12:18:04 +0900
committerHiroshi SHIBATA <[email protected]>2024-12-02 15:32:05 +0900
commit94f8bc95e3c6e7917628e0465c687bd61d6d8531 (patch)
tree43e7bd1c4dd38b807a4d64341593e48cf517a07d /test
parenteb0442a58177525dde6b68c30ee2d0755260ac28 (diff)
[ruby/securerandom] Enabled test_s_random_bytes_is_fork_safe on GitHub Actions
https://github.com/ruby/securerandom/commit/bb1c078e9f
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12231
Diffstat (limited to 'test')
-rw-r--r--test/test_securerandom.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/test_securerandom.rb b/test/test_securerandom.rb
index cf82943b8d..e2bdf26757 100644
--- a/test/test_securerandom.rb
+++ b/test/test_securerandom.rb
@@ -9,9 +9,9 @@ class TestSecureRandom < Test::Unit::TestCase
@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'
@@ -21,7 +21,7 @@ if false
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
@@ -60,7 +60,6 @@ if false
end
false # not recycled?
end
-end
def test_with_openssl
begin