aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/spec/generic/rpc_server_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/spec/generic/rpc_server_spec.rb')
-rw-r--r--src/ruby/spec/generic/rpc_server_spec.rb23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/ruby/spec/generic/rpc_server_spec.rb b/src/ruby/spec/generic/rpc_server_spec.rb
index d95a021311..be6331d68b 100644
--- a/src/ruby/spec/generic/rpc_server_spec.rb
+++ b/src/ruby/spec/generic/rpc_server_spec.rb
@@ -141,7 +141,7 @@ describe GRPC::RpcServer do
@server = GRPC::Core::Server.new(@server_queue, nil)
server_port = @server.add_http2_port(server_host, :this_port_is_insecure)
@host = "localhost:#{server_port}"
- @ch = GRPC::Core::Channel.new(@host, nil)
+ @ch = GRPC::Core::Channel.new(@host, nil, :this_channel_is_insecure)
end
describe '#new' do
@@ -355,7 +355,8 @@ describe GRPC::RpcServer do
req = EchoMsg.new
blk = proc do
cq = GRPC::Core::CompletionQueue.new
- stub = GRPC::ClientStub.new(@host, cq, **client_opts)
+ stub = GRPC::ClientStub.new(@host, cq, :this_channel_is_insecure,
+ **client_opts)
stub.request_response('/unknown', req, marshal, unmarshal)
end
expect(&blk).to raise_error GRPC::BadStatus
@@ -369,7 +370,7 @@ describe GRPC::RpcServer do
@srv.wait_till_running
req = EchoMsg.new
n = 5 # arbitrary
- stub = EchoStub.new(@host, **client_opts)
+ stub = EchoStub.new(@host, :this_channel_is_insecure, **client_opts)
n.times { expect(stub.an_rpc(req)).to be_a(EchoMsg) }
@srv.stop
t.join
@@ -381,7 +382,7 @@ describe GRPC::RpcServer do
t = Thread.new { @srv.run }
@srv.wait_till_running
req = EchoMsg.new
- stub = EchoStub.new(@host, **client_opts)
+ stub = EchoStub.new(@host, :this_channel_is_insecure, **client_opts)
expect(stub.an_rpc(req, k1: 'v1', k2: 'v2')).to be_a(EchoMsg)
wanted_md = [{ 'k1' => 'v1', 'k2' => 'v2' }]
check_md(wanted_md, service.received_md)
@@ -395,7 +396,7 @@ describe GRPC::RpcServer do
t = Thread.new { @srv.run }
@srv.wait_till_running
req = EchoMsg.new
- stub = SlowStub.new(@host, **client_opts)
+ stub = SlowStub.new(@host, :this_channel_is_insecure, **client_opts)
timeout = service.delay + 1.0 # wait for long enough
resp = stub.an_rpc(req, timeout: timeout, k1: 'v1', k2: 'v2')
expect(resp).to be_a(EchoMsg)
@@ -411,7 +412,7 @@ describe GRPC::RpcServer do
t = Thread.new { @srv.run }
@srv.wait_till_running
req = EchoMsg.new
- stub = SlowStub.new(@host, **client_opts)
+ stub = SlowStub.new(@host, :this_channel_is_insecure, **client_opts)
op = stub.an_rpc(req, k1: 'v1', k2: 'v2', return_op: true)
Thread.new do # cancel the call
sleep 0.1
@@ -431,7 +432,7 @@ describe GRPC::RpcServer do
threads = [t]
n.times do
threads << Thread.new do
- stub = EchoStub.new(@host, **client_opts)
+ stub = EchoStub.new(@host, :this_channel_is_insecure, **client_opts)
q << stub.an_rpc(req)
end
end
@@ -459,7 +460,7 @@ describe GRPC::RpcServer do
one_failed_as_unavailable = false
n.times do
threads << Thread.new do
- stub = SlowStub.new(@host, **client_opts)
+ stub = SlowStub.new(@host, :this_channel_is_insecure, **client_opts)
begin
stub.an_rpc(req)
rescue GRPC::BadStatus => e
@@ -499,7 +500,7 @@ describe GRPC::RpcServer do
t = Thread.new { @srv.run }
@srv.wait_till_running
req = EchoMsg.new
- stub = EchoStub.new(@host, **client_opts)
+ stub = EchoStub.new(@host, :this_channel_is_insecure, **client_opts)
op = stub.an_rpc(req, k1: 'v1', k2: 'v2', return_op: true)
expect(op.metadata).to be nil
expect(op.execute).to be_a(EchoMsg)
@@ -537,7 +538,7 @@ describe GRPC::RpcServer do
t = Thread.new { @srv.run }
@srv.wait_till_running
req = EchoMsg.new
- stub = FailingStub.new(@host, **client_opts)
+ stub = FailingStub.new(@host, :this_channel_is_insecure, **client_opts)
blk = proc { stub.an_rpc(req) }
# confirm it raise the expected error
@@ -562,7 +563,7 @@ describe GRPC::RpcServer do
t = Thread.new { @srv.run }
@srv.wait_till_running
req = EchoMsg.new
- stub = EchoStub.new(@host, **client_opts)
+ stub = EchoStub.new(@host, :this_channel_is_insecure, **client_opts)
op = stub.an_rpc(req, k1: 'v1', k2: 'v2', return_op: true)
expect(op.metadata).to be nil
expect(op.execute).to be_a(EchoMsg)