diff --git a/src/ruby/lib/grpc/generic/rpc_desc.rb b/src/ruby/lib/grpc/generic/rpc_desc.rb index e1aa33e3183f8d62827dcc481d01715d26bc2628..876397a6e70ea8b4c98cbef350ca0d044f2e2c44 100644 --- a/src/ruby/lib/grpc/generic/rpc_desc.rb +++ b/src/ruby/lib/grpc/generic/rpc_desc.rb @@ -81,7 +81,6 @@ module Google active_call.run_server_bidi(mth) end send_status(active_call, OK, 'OK') - active_call.finished rescue BadStatus => e # this is raised by handlers that want GRPC to send an application # error code and detail message. diff --git a/src/ruby/spec/generic/active_call_spec.rb b/src/ruby/spec/generic/active_call_spec.rb index 599e68bef032c53e459c9b6d6c387a77434d4e16..86495d7369446563272b163b3adf8deecfc9abcd 100644 --- a/src/ruby/spec/generic/active_call_spec.rb +++ b/src/ruby/spec/generic/active_call_spec.rb @@ -166,7 +166,7 @@ describe GRPC::ActiveCall do expect(client_call.remote_read).to eq('server_response') end - it 'saves metadata { status=200 } when the server adds no metadata' do + it 'saves no metadata when the server adds no metadata' do call = make_test_call done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue, deadline) @@ -180,7 +180,7 @@ describe GRPC::ActiveCall do server_call.remote_send('ignore me') expect(client_call.metadata).to be_nil client_call.remote_read - expect(client_call.metadata).to eq(':status' => '200') + expect(client_call.metadata).to eq({}) end it 'saves metadata add by the server' do @@ -197,7 +197,7 @@ describe GRPC::ActiveCall do server_call.remote_send('ignore me') expect(client_call.metadata).to be_nil client_call.remote_read - expected = { ':status' => '200', 'k1' => 'v1', 'k2' => 'v2' } + expected = { 'k1' => 'v1', 'k2' => 'v2' } expect(client_call.metadata).to eq(expected) end @@ -307,7 +307,6 @@ describe GRPC::ActiveCall do server_call.remote_send('server_response') expect(client_call.remote_read).to eq('server_response') server_call.send_status(OK, 'status code is OK') - expect { server_call.finished }.to_not raise_error expect { client_call.finished }.to_not raise_error end @@ -326,7 +325,6 @@ describe GRPC::ActiveCall do server_call.send_status(OK, 'status code is OK') expect(client_call.remote_read).to eq('server_response') expect { client_call.writes_done(false) }.to_not raise_error - expect { server_call.finished }.to_not raise_error expect { client_call.finished }.to_not raise_error end @@ -345,7 +343,6 @@ describe GRPC::ActiveCall do server_call.send_status(OK, 'status code is OK') expect(client_call.remote_read).to eq('server_response') expect { client_call.writes_done(true) }.to_not raise_error - expect { server_call.finished }.to_not raise_error end end diff --git a/src/ruby/spec/generic/client_stub_spec.rb b/src/ruby/spec/generic/client_stub_spec.rb index f1500fbd4435d57d2bb5f19a7737442385cdfa05..c7218da2cff22cf145ac2aa811ff1c3fb659bfdf 100644 --- a/src/ruby/spec/generic/client_stub_spec.rb +++ b/src/ruby/spec/generic/client_stub_spec.rb @@ -434,7 +434,7 @@ describe 'ClientStub' do end expect(c.remote_read).to eq(expected_input) replys.each { |r| c.remote_send(r) } - c.send_status(status, status == @pass ? 'OK' : 'NOK', true) + c.send_status(status, status == @pass ? 'OK' : 'NOK') end end @@ -444,7 +444,7 @@ describe 'ClientStub' do c = expect_server_to_be_invoked(mtx, cnd) expected_inputs.each { |i| expect(c.remote_read).to eq(i) } replys.each { |r| c.remote_send(r) } - c.send_status(status, status == @pass ? 'OK' : 'NOK', true) + c.send_status(status, status == @pass ? 'OK' : 'NOK') end end @@ -460,7 +460,7 @@ describe 'ClientStub' do expect(c.remote_read).to eq(i) end end - c.send_status(status, status == @pass ? 'OK' : 'NOK', true) + c.send_status(status, status == @pass ? 'OK' : 'NOK') end end @@ -473,7 +473,7 @@ describe 'ClientStub' do expect(c.metadata[k.to_s]).to eq(v) end c.remote_send(resp) - c.send_status(status, status == @pass ? 'OK' : 'NOK', true) + c.send_status(status, status == @pass ? 'OK' : 'NOK') end end @@ -486,7 +486,7 @@ describe 'ClientStub' do expect(c.metadata[k.to_s]).to eq(v) end c.remote_send(resp) - c.send_status(status, status == @pass ? 'OK' : 'NOK', true) + c.send_status(status, status == @pass ? 'OK' : 'NOK') end end diff --git a/src/ruby/spec/generic/rpc_desc_spec.rb b/src/ruby/spec/generic/rpc_desc_spec.rb index ac0b5c51f401e0363cee889d1614a4957d37cb39..54ccf7ab8b0db9957331aaaf17a1174f890fb29d 100644 --- a/src/ruby/spec/generic/rpc_desc_spec.rb +++ b/src/ruby/spec/generic/rpc_desc_spec.rb @@ -94,7 +94,6 @@ describe GRPC::RpcDesc do expect(@call).to receive(:remote_read).once.and_return(req) expect(@call).to receive(:remote_send).once.with(@ok_response) expect(@call).to receive(:send_status).once.with(OK, 'OK') - expect(@call).to receive(:finished).once @request_response.run_server_method(@call, method(:fake_reqresp)) end end @@ -135,7 +134,6 @@ describe GRPC::RpcDesc do it 'sends a response and closes the stream if there no errors' do expect(@call).to receive(:remote_send).once.with(@ok_response) expect(@call).to receive(:send_status).once.with(OK, 'OK') - expect(@call).to receive(:finished).once @client_streamer.run_server_method(@call, method(:fake_clstream)) end end @@ -180,7 +178,6 @@ describe GRPC::RpcDesc do expect(@call).to receive(:remote_read).once.and_return(req) expect(@call).to receive(:remote_send).twice.with(@ok_response) expect(@call).to receive(:send_status).once.with(OK, 'OK') - expect(@call).to receive(:finished).once @server_streamer.run_server_method(@call, method(:fake_svstream)) end end @@ -210,7 +207,6 @@ describe GRPC::RpcDesc do it 'closes the stream if there no errors' do expect(@call).to receive(:run_server_bidi) expect(@call).to receive(:send_status).once.with(OK, 'OK') - expect(@call).to receive(:finished).once @bidi_streamer.run_server_method(@call, method(:fake_bidistream)) end end