| 233 | } |
| 234 | |
| 235 | TEST_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 | |
| 255 | TEST_F(StreamingRpcTest, batch_create_stream_feedback_race) { |
| 256 | BatchStreamFeedbackRaceState state; |
nothing calls this directly
no test coverage detected