pull/14616/head
yang-g 7 years ago
parent abd9d53a9f
commit 4a15f4016e
  1. 9
      test/core/end2end/tests/bad_ping.cc

@ -155,14 +155,15 @@ static void test_bad_ping(grpc_end2end_test_config config) {
cq_verify(cqv); cq_verify(cqv);
// Send too many pings to the server to trigger the punishment: // Send too many pings to the server to trigger the punishment:
// Each ping will trigger a ping strike, and we need at least MAX_PING_STRIKES // The first ping will let server mark its last_recv time. Afterwards, each
// strikes to trigger the punishment. So (MAX_PING_STRIKES + 1) pings are // ping will trigger a ping strike, and we need at least MAX_PING_STRIKES
// strikes to trigger the punishment. So (MAX_PING_STRIKES + 2) pings are
// needed here. // needed here.
int i; int i;
for (i = 1; i <= MAX_PING_STRIKES + 1; i++) { for (i = 1; i <= MAX_PING_STRIKES + 2; i++) {
grpc_channel_ping(f.client, f.cq, tag(200 + i), nullptr); grpc_channel_ping(f.client, f.cq, tag(200 + i), nullptr);
CQ_EXPECT_COMPLETION(cqv, tag(200 + i), 1); CQ_EXPECT_COMPLETION(cqv, tag(200 + i), 1);
if (i == MAX_PING_STRIKES + 1) { if (i == MAX_PING_STRIKES + 2) {
CQ_EXPECT_COMPLETION(cqv, tag(1), 1); CQ_EXPECT_COMPLETION(cqv, tag(1), 1);
} }
cq_verify(cqv); cq_verify(cqv);

Loading…
Cancel
Save