Sha256: 39634019fccc555d3d1c4e50a267a67796c24a9d9b7dd60b609b27acad727ea1

Contents?: true

Size: 1.17 KB

Versions: 15

Compression:

Stored size: 1.17 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

require 'multiverse_helpers'

class PipeManagerTest < Minitest::Test
  include MultiverseHelpers

  setup_and_teardown_agent

  def after_setup
    @listener = NewRelic::Agent::PipeChannelManager.listener
  end

  def after_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

15 entries across 15 versions & 1 rubygems

Version Path
newrelic_rpm-3.10.0.279 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.9.275 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.8.273 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.7.266 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.6.257 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.5.251 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.4.245 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.3.241 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.2.239 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.1.236 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.9.0.229 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.8.1.221 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.8.0.218 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.7.3.204 test/multiverse/suites/agent_only/pipe_manager_test.rb
newrelic_rpm-3.7.3.199 test/multiverse/suites/agent_only/pipe_manager_test.rb