Skip to content

Commit 7b785dc

Browse files
committed
Test
1 parent 3125554 commit 7b785dc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/spec/ruby/rack/application_spec.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,17 @@ def createRackServletWrapper(runtime, rackup, filename)
761761
expect(@pooling_factory.getApplication).to eq app2
762762
end
763763

764+
class ThreadSafeMock
765+
def initialize(obj)
766+
@delegate = obj
767+
@lock = Mutex.new
768+
end
769+
770+
def method_missing(name, *args, &block)
771+
@lock.synchronize { @delegate.send(name, *args, &block) }
772+
end
773+
end
774+
764775
it "gets and initializes new applications until maximum allows to create more" do
765776
app_init_millis = 100
766777
allow(@factory).to receive(:init)
@@ -796,10 +807,7 @@ def createRackServletWrapper(runtime, rackup, filename)
796807
end
797808

798809
it "initializes initial runtimes in parallel (with wait set to false)" do
799-
@pooling_factory = org.jruby.rack.PoolingRackApplicationFactory.new @factory
800-
@pooling_factory.context = @rack_context
801-
802-
app_init_secs = 0.15
810+
app_init_secs = 0.05
803811
allow(@factory).to receive(:init)
804812
allow(@factory).to receive(:newApplication) do
805813
app = double("app").as_null_object

0 commit comments

Comments
 (0)