Rename deadline/timeout

pull/23164/head
Alexander Polcyn 5 years ago
parent 46c13cd870
commit 5727ccc28f
  1. 6
      test/cpp/interop/client.cc
  2. 14
      test/cpp/interop/interop_client.cc
  3. 6
      test/cpp/interop/interop_client.h

@ -97,7 +97,7 @@ DEFINE_int32(soak_max_failures, 0,
DEFINE_int32(soak_per_iteration_max_acceptable_latency_ms, 0,
"The number of milliseconds a single iteration in the two soak "
"tests (rpc_soak and channel_soak) should take.");
DEFINE_int32(soak_overall_deadline_seconds, 0,
DEFINE_int32(soak_overall_timeout_seconds, 0,
"The overall number of seconds after which a soak test should "
"stop and fail, if the desired number of iterations have not yet "
"completed.");
@ -270,12 +270,12 @@ int main(int argc, char** argv) {
std::bind(&grpc::testing::InteropClient::DoChannelSoakTest, &client,
FLAGS_soak_iterations, FLAGS_soak_max_failures,
FLAGS_soak_per_iteration_max_acceptable_latency_ms,
FLAGS_soak_overall_deadline_seconds);
FLAGS_soak_overall_timeout_seconds);
actions["rpc_soak"] =
std::bind(&grpc::testing::InteropClient::DoRpcSoakTest, &client,
FLAGS_soak_iterations, FLAGS_soak_max_failures,
FLAGS_soak_per_iteration_max_acceptable_latency_ms,
FLAGS_soak_overall_deadline_seconds);
FLAGS_soak_overall_timeout_seconds);
actions["long_lived_channel"] =
std::bind(&grpc::testing::InteropClient::DoLongLivedChannelTest, &client,
FLAGS_soak_iterations, FLAGS_iteration_interval);

@ -1107,14 +1107,14 @@ void InteropClient::PerformSoakTest(
const bool reset_channel_per_iteration, const int32_t soak_iterations,
const int32_t max_failures,
const int32_t max_acceptable_per_iteration_latency_ms,
const int32_t overall_deadline_seconds) {
const int32_t overall_timeout_seconds) {
std::vector<std::tuple<bool, int32_t, std::string>> results;
grpc_histogram* latencies_ms_histogram = grpc_histogram_create(
1 /* resolution */,
500 * 1e3 /* largest bucket; 500 seconds is unlikely */);
gpr_timespec overall_deadline = gpr_time_add(
gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_seconds(overall_deadline_seconds, GPR_TIMESPAN));
gpr_time_from_seconds(overall_timeout_seconds, GPR_TIMESPAN));
int32_t iterations_ran = 0;
for (int i = 0;
i < soak_iterations &&
@ -1159,7 +1159,7 @@ void InteropClient::PerformSoakTest(
"Some or all of the iterations that did run were unexpectedly slow. "
"See breakdown above for which iterations succeeded, failed, and "
"why for more info.",
overall_deadline_seconds, iterations_ran, soak_iterations,
overall_timeout_seconds, iterations_ran, soak_iterations,
total_failures, max_failures, latency_ms_median, latency_ms_90th,
latency_ms_worst);
GPR_ASSERT(0);
@ -1192,12 +1192,12 @@ void InteropClient::PerformSoakTest(
bool InteropClient::DoRpcSoakTest(
int32_t soak_iterations, int32_t max_failures,
int64_t max_acceptable_per_iteration_latency_ms,
int32_t overall_deadline_seconds) {
int32_t overall_timeout_seconds) {
gpr_log(GPR_DEBUG, "Sending %d RPCs...", soak_iterations);
GPR_ASSERT(soak_iterations > 0);
PerformSoakTest(false /* reset channel per iteration */, soak_iterations,
max_failures, max_acceptable_per_iteration_latency_ms,
overall_deadline_seconds);
overall_timeout_seconds);
gpr_log(GPR_DEBUG, "rpc_soak test done.");
return true;
}
@ -1205,13 +1205,13 @@ bool InteropClient::DoRpcSoakTest(
bool InteropClient::DoChannelSoakTest(
int32_t soak_iterations, int32_t max_failures,
int64_t max_acceptable_per_iteration_latency_ms,
int32_t overall_deadline_seconds) {
int32_t overall_timeout_seconds) {
gpr_log(GPR_DEBUG, "Sending %d RPCs, tearing down the channel each time...",
soak_iterations);
GPR_ASSERT(soak_iterations > 0);
PerformSoakTest(true /* reset channel per iteration */, soak_iterations,
max_failures, max_acceptable_per_iteration_latency_ms,
overall_deadline_seconds);
overall_timeout_seconds);
gpr_log(GPR_DEBUG, "channel_soak test done.");
return true;
}

@ -78,10 +78,10 @@ class InteropClient {
// languages
bool DoChannelSoakTest(int32_t soak_iterations, int32_t max_failures,
int64_t max_acceptable_per_iteration_latency_ms,
int32_t overall_deadline_seconds);
int32_t overall_timeout_seconds);
bool DoRpcSoakTest(int32_t soak_iterations, int32_t max_failures,
int64_t max_acceptable_per_iteration_latency_ms,
int32_t overall_deadline_seconds);
int32_t overall_timeout_seconds);
bool DoLongLivedChannelTest(int32_t soak_iterations,
int32_t iteration_interval);
@ -140,7 +140,7 @@ class InteropClient {
const int32_t soak_iterations,
const int32_t max_failures,
const int32_t max_acceptable_per_iteration_latency_ms,
const int32_t overall_deadline_seconds);
const int32_t overall_timeout_seconds);
ServiceStub serviceStub_;
/// If true, abort() is not called for transient failures

Loading…
Cancel
Save