This repository was archived by the owner on Mar 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +7
-3
lines changed Expand file tree Collapse file tree 5 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,5 @@ matrix:
3939 - rvm : ruby-head
4040 - rvm : jruby-head
4141 - rvm : 1.9.3
42+
43+ script : " rake TESTOPTS='--seed=1'"
Original file line number Diff line number Diff line change 44class TestArray < Minitest ::Test
55 def test_concurrency
66 ary = ThreadSafe ::Array . new
7- ( 1 ..100 ) . map do |i |
7+ ( 1 ..THREADS ) . map do |i |
88 Thread . new do
99 1000 . times do
1010 ary << i
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def setup
1111
1212 def test_concurrency
1313 cache = @cache
14- ( 1 ..100 ) . map do |i |
14+ ( 1 ..THREADS ) . map do |i |
1515 Thread . new do
1616 1000 . times do |j |
1717 key = i *1000 +j
Original file line number Diff line number Diff line change 44class TestHash < Minitest ::Test
55 def test_concurrency
66 hsh = ThreadSafe ::Hash . new
7- ( 1 ..100 ) . map do |i |
7+ ( 1 ..THREADS ) . map do |i |
88 Thread . new do
99 1000 . times do |j |
1010 hsh [ i *1000 +j ] = i
Original file line number Diff line number Diff line change 2929require 'thread'
3030require 'thread_safe'
3131
32+ THREADS = ( RUBY_ENGINE == 'ruby' ? 100 : 10 )
33+
3234if defined? ( JRUBY_VERSION ) && ENV [ 'TEST_NO_UNSAFE' ]
3335 # to be used like this: rake test TEST_NO_UNSAFE=true
3436 load 'test/package.jar'
You can’t perform that action at this time.
0 commit comments