Sha256: f317eb20dbdcd2e82df6e17042ef7d9e11b1284bdbc5ea9d41f6ee59ed10ef93

Contents?: true

Size: 1.02 KB

Versions: 17

Compression:

Stored size: 1.02 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.

require './app'
require 'rails/test_help'
require 'multiverse_helpers'

class BadInstrumentationController < ApplicationController
  include Rails.application.routes.url_helpers

  # This action is intended to simulate a chunk of instrumentation that pushes
  # a TT scope, but then never pops it. Such a situation will break
  # instrumentation of that request, but should not actually cause the request
  # to fail.
  # https://newrelic.atlassian.net/browse/RUBY-1158
  def failwhale
    NewRelic::Agent.instance.stats_engine.push_scope('failwhale', Time.now)
    render :text => 'everything went great'
  end
end

class BadInstrumentationTest < ActionDispatch::IntegrationTest
  include MultiverseHelpers
  setup_and_teardown_agent

  def test_unbalanced_tt_stack_should_not_cause_request_to_fail
    rsp = get '/bad_instrumentation/failwhale'
    assert_equal(200, rsp.to_i)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.3.204 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.3.199 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.2.195 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.2.192 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.2.190.beta test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.1.188 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.1.182 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.1.180 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.0.177 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.7.0.174.beta test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.6.9.171 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.6.8.168 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.6.8.164 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.6.7.159 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.6.7.159.beta test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.6.7.152 test/multiverse/suites/rails/bad_instrumentation_test.rb
newrelic_rpm-3.6.6.147 test/multiverse/suites/rails/bad_instrumentation_test.rb