| 1248 | } |
| 1249 | |
| 1250 | void SendSleepRPC(butil::EndPoint ep, int sleep_ms, bool succ) { |
| 1251 | brpc::Channel channel; |
| 1252 | ASSERT_EQ(0, channel.Init(ep, NULL)); |
| 1253 | |
| 1254 | brpc::Controller cntl; |
| 1255 | test::EchoRequest req; |
| 1256 | test::EchoResponse res; |
| 1257 | req.set_message(EXP_REQUEST); |
| 1258 | if (sleep_ms > 0) { |
| 1259 | req.set_sleep_us(sleep_ms * 1000); |
| 1260 | } |
| 1261 | test::EchoService_Stub stub(&channel); |
| 1262 | stub.Echo(&cntl, &req, &res, NULL); |
| 1263 | if (succ) { |
| 1264 | EXPECT_FALSE(cntl.Failed()) << cntl.ErrorText() |
| 1265 | << " latency=" << cntl.latency_us(); |
| 1266 | } else { |
| 1267 | EXPECT_TRUE(cntl.Failed()); |
| 1268 | } |
| 1269 | } |
| 1270 | |
| 1271 | TEST_F(ServerTest, close_idle_connections) { |
| 1272 | butil::EndPoint ep; |
nothing calls this directly
no test coverage detected