Sha256: 7bcf742496a38e97e08b80dff7c13c0e1ecc4820e92fcbe250fc17a03b2f63f9

Contents?: true

Size: 756 Bytes

Versions: 47

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

require "abstract_unit"

class DebugLocksTest < ActionDispatch::IntegrationTest
  setup do
    build_app
  end

  def test_render_threads_status
    thread_ready = Concurrent::CountDownLatch.new
    test_terminated = Concurrent::CountDownLatch.new

    thread = Thread.new do
      ActiveSupport::Dependencies.interlock.running do
        thread_ready.count_down
        test_terminated.wait
      end
    end

    thread_ready.wait

    get "/rails/locks"

    test_terminated.count_down

    assert_match(/Thread.*?Sharing/, @response.body)
  ensure
    thread.join
  end

  private
    def build_app
      @app = self.class.build_app do |middleware|
        middleware.use ActionDispatch::DebugLocks
      end
    end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
jets-1.9.7 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.9.6 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.9.5 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.9.4 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.9.3 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.9.2 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.9.1 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.9.0 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.14 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.13 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.12 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.11 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.10 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.9 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.8 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.7 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.6 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.5 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.4 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb
jets-1.8.3 vendor/rails/actionpack/test/dispatch/debug_locks_test.rb