spec/generic/client_stub_spec.rb in grpc-0.5.0 vs spec/generic/client_stub_spec.rb in grpc-0.6.0
- old
+ new
@@ -382,17 +382,11 @@
e = get_responses(stub)
expect(e.collect { |r| r }).to eq(@sent_msgs)
th.join
end
- # disabled because an unresolved wire-protocol implementation feature
- #
- # - servers should be able initiate messaging, however, as it stand
- # servers don't know if all the client metadata has been sent until
- # they receive a message from the client. Without receiving all the
- # metadata, the server does not accept the call, so this test hangs.
- xit 'supports a server-initiated ping pong', bidi: true do
+ it 'supports a server-initiated ping pong', bidi: true do
server_port = create_test_server
host = "localhost:#{server_port}"
th = run_bidi_streamer_echo_ping_pong(@sent_msgs, @pass, false)
stub = GRPC::ClientStub.new(host, @cq)
e = get_responses(stub)
@@ -432,21 +426,21 @@
wanted_metadata.each do |k, v|
expect(c.metadata[k.to_s]).to eq(v)
end
expect(c.remote_read).to eq(expected_input)
replys.each { |r| c.remote_send(r) }
- c.send_status(status, status == @pass ? 'OK' : 'NOK')
+ c.send_status(status, status == @pass ? 'OK' : 'NOK', true)
end
end
def run_bidi_streamer_handle_inputs_first(expected_inputs, replys,
status)
wakey_thread do |mtx, cnd|
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')
+ c.send_status(status, status == @pass ? 'OK' : 'NOK', true)
end
end
def run_bidi_streamer_echo_ping_pong(expected_inputs, status, client_starts)
wakey_thread do |mtx, cnd|
@@ -458,11 +452,11 @@
else
c.remote_send(i)
expect(c.remote_read).to eq(i)
end
end
- c.send_status(status, status == @pass ? 'OK' : 'NOK')
+ c.send_status(status, status == @pass ? 'OK' : 'NOK', true)
end
end
def run_client_streamer(expected_inputs, resp, status, **kw)
wanted_metadata = kw.clone
@@ -471,11 +465,11 @@
expected_inputs.each { |i| expect(c.remote_read).to eq(i) }
wanted_metadata.each do |k, v|
expect(c.metadata[k.to_s]).to eq(v)
end
c.remote_send(resp)
- c.send_status(status, status == @pass ? 'OK' : 'NOK')
+ c.send_status(status, status == @pass ? 'OK' : 'NOK', true)
end
end
def run_request_response(expected_input, resp, status, **kw)
wanted_metadata = kw.clone
@@ -484,10 +478,10 @@
expect(c.remote_read).to eq(expected_input)
wanted_metadata.each do |k, v|
expect(c.metadata[k.to_s]).to eq(v)
end
c.remote_send(resp)
- c.send_status(status, status == @pass ? 'OK' : 'NOK')
+ c.send_status(status, status == @pass ? 'OK' : 'NOK', true)
end
end
def create_test_server
@server_queue = GRPC::Core::CompletionQueue.new