Sha256: 5b65c1c6d065e889857e7d3476421e750d8cd64d4b20d65e677f752ff99beeee

Contents?: true

Size: 652 Bytes

Versions: 5

Compression:

Stored size: 652 Bytes

Contents

# $Id: testthreads.rb,v 1.3 2009/09/29 17:56:35 colbygk Exp $
# Test guts sent in by chetreddy bug #27184
# 
# Note: this test won't always catch a threading problem, as it
# relies on a brute force approach.  NUM_THREADS can be increased
# to stress the system longer and therefore increasing the chance
# of exposing a threading issue, however, it is not a definitive
# test.
#

class TestThreads < TestCase
  def test_threads
    NUM_THREADS=2000
    assert_no_exception
    {
      (0..NUM_THREADS).map do |i|
      Thread.new do
	Thread.current[:logger] = Log4r::Logger.new "Hello #{i}"
      end
      end.each { |thr| thr.join }
    }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
log4r-1.1.7 tests/testthreads.rb
log4r-1.1.6 tests/testthreads.rb
log4r-1.1.5 tests/testthreads.rb
log4r-1.1.4 tests/testthreads.rb
log4r-1.1.3 tests/testthreads.rb