Skip to content

Commit 0a0330d

Browse files
committed
Fix performance spec - don't use container in reactor.
1 parent c0337a8 commit 0a0330d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/async/http/performance_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
require 'etc'
2828

2929
RSpec.shared_examples_for 'client benchmark' do
30-
include_context Async::RSpec::Reactor
31-
3230
let(:endpoint) {Async::HTTP::Endpoint.parse('http://127.0.0.1:9294', timeout: 0.8, reuse_port: true)}
3331

3432
let(:server) do
@@ -42,8 +40,10 @@
4240
let(:concurrency) {Etc.nprocessors || 2}
4341

4442
before do
45-
# We bind the endpoint before running the server so that we know incoming connections will be accepted:
46-
@bound_endpoint = Async::IO::SharedEndpoint.bound(endpoint)
43+
Sync do
44+
# We bind the endpoint before running the server so that we know incoming connections will be accepted:
45+
@bound_endpoint = Async::IO::SharedEndpoint.bound(endpoint)
46+
end
4747

4848
# I feel a dedicated class might be better than this hack:
4949
allow(@bound_endpoint).to receive(:protocol).and_return(endpoint.protocol)

0 commit comments

Comments
 (0)