| 1133 | } |
| 1134 | |
| 1135 | void* incr_thread(void* arg) { |
| 1136 | brpc::Channel* c = static_cast<brpc::Channel*>(arg); |
| 1137 | for (int i = 0; i < 5000; ++i) { |
| 1138 | brpc::RedisRequest request; |
| 1139 | brpc::RedisResponse response; |
| 1140 | brpc::Controller cntl; |
| 1141 | EXPECT_TRUE(request.AddCommand("incr count")); |
| 1142 | c->CallMethod(NULL, &cntl, &request, &response, NULL); |
| 1143 | EXPECT_FALSE(cntl.Failed()) << cntl.ErrorText(); |
| 1144 | EXPECT_EQ(1, response.reply_size()); |
| 1145 | EXPECT_TRUE(response.reply(0).is_integer()) << response.reply(0); |
| 1146 | } |
| 1147 | return NULL; |
| 1148 | } |
| 1149 | |
| 1150 | TEST_F(RedisTest, server_concurrency) { |
| 1151 | std::string password = GeneratePassword(); |
nothing calls this directly
no test coverage detected