diff --git a/test/test_securerandom.rb b/test/test_securerandom.rb index cf82943..e2bdf26 100644 --- a/test/test_securerandom.rb +++ b/test/test_securerandom.rb @@ -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' @@ -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 @@ -60,7 +60,6 @@ def check_forking_random_bytes(target_pid, target) end false # not recycled? end -end def test_with_openssl begin