MCPcopy Create free account
hub / github.com/apache/brpc / TEST_F

Function TEST_F

test/brpc_streaming_rpc_unittest.cpp:235–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235TEST_F(StreamingRpcTest, sanity) {
236 brpc::Server server;
237 MyServiceWithStream service;
238 ASSERT_EQ(0, server.AddService(&service, brpc::SERVER_DOESNT_OWN_SERVICE));
239 ASSERT_EQ(0, server.Start(9007, NULL));
240 brpc::Channel channel;
241 ASSERT_EQ(0, channel.Init("127.0.0.1:9007", NULL));
242 brpc::Controller cntl;
243 brpc::StreamId request_stream;
244 ASSERT_EQ(0, StreamCreate(&request_stream, cntl, NULL));
245 brpc::ScopedStream stream_guard(request_stream);
246 test::EchoService_Stub stub(&channel);
247 stub.Echo(&cntl, &request, &response, NULL);
248 ASSERT_FALSE(cntl.Failed()) << cntl.ErrorText() << " request_stream=" << request_stream;
249 usleep(10);
250 brpc::StreamClose(request_stream);
251 server.Stop(0);
252 server.Join();
253}
254
255TEST_F(StreamingRpcTest, batch_create_stream_feedback_race) {
256 BatchStreamFeedbackRaceState state;

Callers

nothing calls this directly

Calls 15

StreamCreateFunction · 0.85
StreamCloseFunction · 0.85
bthread_mutex_lockFunction · 0.85
bthread_joinFunction · 0.85
NewCallbackFunction · 0.85
WaitForTrueFunction · 0.85
bthread_mutex_unlockFunction · 0.85
StreamWriteFunction · 0.85
StreamWaitFunction · 0.85
microseconds_from_nowFunction · 0.85
SendStreamRstFunction · 0.85
cpuwide_time_msFunction · 0.85

Tested by

no test coverage detected