Sha256: a1a038dd6418c456a1164243fd75903f8dffba5763f5e80eb37542d0cb465765

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

# 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

17 entries across 17 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.5.130 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.4.122 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.4.113.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.3.111 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.3.106 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.3.105.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.3.104 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.3.103.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.2.96 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.2.90.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.1.88 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.1.87 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.1.86.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.1.85.beta test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.0.83 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.0.78 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.6.0.74.beta test/multiverse/suites/agent_only/pipe_manager_test.rb