Sha256: f47caa2385efa2ec0a82b654d144e6b45ee73145f2cbeaee4ff9f94bdb7afb11

Contents?: true

Size: 961 Bytes

Versions: 27

Compression:

Stored size: 961 Bytes

Contents

# https://newrelic.atlassian.net/browse/RUBY-669

class PipeManagerTest < Test::Unit::TestCase
  def setup
    @listener = NewRelic::Agent::PipeChannelManager.listener
  end

  def teardown
    @listener.stop
  end
  
  def test_old_pipes_are_cleaned_up_after_timeout
    @listener.timeout = 1
    NewRelic::Agent::PipeChannelManager.register_report_channel(:timeout_test)
    sleep 2
    @listener.start
    sleep 0.5 # give the thread some time to start, and clean things up
    assert_nil NewRelic::Agent::PipeChannelManager.channels[:timeout_test]
  end

  def test_pipes_are_regularly_checked_for_freshness
    @listener.select_timeout = 1
    @listener.timeout = 2
    NewRelic::Agent::PipeChannelManager.register_report_channel(:select_test)
    
    sleep 1.5
    @listener.start
    assert NewRelic::Agent::PipeChannelManager.channels[:select_test]
    
    sleep 1.5
    assert_nil NewRelic::Agent::PipeChannelManager.channels[:select_test]
  end
end

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
wd_newrelic_rpm-3.5.8 test/multiverse/suites/agent_only/pipe_manager_test.rb
sundawg_newrelic_rpm-3.5.8.2 test/multiverse/suites/agent_only/pipe_manager_test.rb
sundawg_newrelic_rpm-3.5.8.1 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.8.72 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.8.70 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.8.64.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.7.59 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.7.59.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.7.58.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
wd_newrelic_rpm-3.5.6 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.7.57.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.6.55 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.6.48.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.6.46.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.6.42.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.5.39.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
wd_newrelic_rpm-3.5.5 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.5.38 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.5.540.dev test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.5.4.35.beta test/multiverse/suites/agent_only/pipe_manager_test.rb