Sha256: 511311740a04081d3b123fc47c0297b4376d80a202ad375f01af7a2e252e47d1

Contents?: true

Size: 833 Bytes

Versions: 61

Compression:

Stored size: 833 Bytes

Contents

# $Id$
# 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.
#

require 'test_helper'

class TestThreads < TestCase
  include Log4r

  NUMTHREADS = 1000

  def test_threads

    assert_nothing_raised do
      (0..NUMTHREADS).map do |i|
        Thread.new do
          Thread.current[:logger] = Log4r::Logger.new "Hello #{i}"
          Thread.current[:logger].outputters = [StdoutOutputter.new("log4r#{i}")]
          Thread.current[:logger].outputters.each { |j| j.flush }
          Thread.current.exit()
        end
      end.each do |thr| thr.join end
    end
  end
end

Version data entries

61 entries across 53 versions & 12 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/tests/testthreads.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/tests/testthreads.rb