Sha256: 4deddc76e6bc02bbe712fdcc4b7c70e48660b81db5151fba951676d02a169ac4
Contents?: true
Size: 1.13 KB
Versions: 9
Compression:
Stored size: 1.13 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 'new_relic/rack/browser_monitoring' require 'new_relic/rack/agent_hooks' require 'new_relic/rack/error_collector' if NewRelic::Agent::Instrumentation::RackHelpers.rack_version_supported? class RackEnvMutationTest < Minitest::Test attr_accessor :inner_app include MultiverseHelpers include Rack::Test::Methods setup_and_teardown_agent class BadApp def call(env) Thread.new do 100.times do env.each do |k, v| # allow main thread to run while we're still in the middle of # iterating Thread.pass end end end # Give the thread we just spawned a chance to start up Thread.pass [200, {}, ['cool story']] end end def app inner_app = BadApp.new Rack::Builder.app do use NewRelic::Rack::AgentHooks run inner_app end end def test_safe_from_iterations_over_rack_env_from_background_threads 100.times do get '/' end end end end
Version data entries
9 entries across 9 versions & 1 rubygems