Merge pull request #11913 from apolcyn/debug_new_ruby_flake

Fix ruby test flake
pull/11876/head
apolcyn 8 years ago committed by GitHub
commit a2f0e19725
  1. 23
      src/ruby/spec/generic/client_stub_spec.rb

@ -451,10 +451,31 @@ describe 'ClientStub' do
/Header values must be of type string or array/)
end
def run_server_streamer_against_client_with_unmarshal_error(
expected_input, replys)
wakey_thread do |notifier|
c = expect_server_to_be_invoked(notifier)
expect(c.remote_read).to eq(expected_input)
begin
replys.each { |r| c.remote_send(r) }
rescue GRPC::Core::CallError
# An attempt to write to the client might fail. This is ok
# because the client call is expected to fail when
# unmarshalling the first response, and to cancel the call,
# and there is a race as for when the server-side call will
# start to fail.
p 'remote_send failed (allowed because call expected to cancel)'
ensure
c.send_status(OK, 'OK', true)
end
end
end
it 'the call terminates when there is an unmarshalling error' do
server_port = create_test_server
host = "localhost:#{server_port}"
th = run_server_streamer(@sent_msg, @replys, @pass)
th = run_server_streamer_against_client_with_unmarshal_error(
@sent_msg, @replys)
stub = GRPC::ClientStub.new(host, :this_channel_is_insecure)
unmarshal = proc { fail(ArgumentError, 'test unmarshalling error') }

Loading…
Cancel
Save