[core e2e tests] use slowdown factor when injecting deadline via service config (#34548)

pull/34579/head
Mark D. Roth 1 year ago committed by GitHub
parent 24f995538c
commit 194c447653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      test/core/end2end/tests/cancel_after_accept.cc
  2. 21
      test/core/end2end/tests/cancel_after_round_trip.cc

@ -18,6 +18,7 @@
#include <memory>
#include "absl/strings/str_cat.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@ -28,6 +29,7 @@
#include "src/core/lib/gprpp/time.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
#include "test/core/util/test_config.h"
namespace grpc_core {
@ -82,15 +84,18 @@ CORE_END2END_TEST(CoreClientChannelTest, DeadlineAfterAcceptWithServiceConfig) {
InitServer(ChannelArgs());
InitClient(ChannelArgs().Set(
GRPC_ARG_SERVICE_CONFIG,
"{\n"
" \"methodConfig\": [ {\n"
" \"name\": [\n"
" { \"service\": \"service\", \"method\": \"method\" },\n"
" { \"service\": \"unused\" }\n"
" ],\n"
" \"timeout\": \"5s\"\n"
" } ]\n"
"}"));
absl::StrCat(
"{\n"
" \"methodConfig\": [ {\n"
" \"name\": [\n"
" { \"service\": \"service\", \"method\": \"method\" },\n"
" { \"service\": \"unused\" }\n"
" ],\n"
" \"timeout\": \"",
5 * grpc_test_slowdown_factor(),
"s\"\n"
" } ]\n"
"}")));
CancelAfterAccept(*this, std::make_unique<DeadlineCancellationMode>(),
Duration::Infinity());
}

@ -18,6 +18,7 @@
#include <memory>
#include "absl/strings/str_cat.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
@ -28,6 +29,7 @@
#include "src/core/lib/gprpp/time.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
#include "test/core/util/test_config.h"
namespace grpc_core {
namespace {
@ -83,14 +85,17 @@ CORE_END2END_TEST(CoreClientChannelTest,
InitServer(ChannelArgs());
InitClient(ChannelArgs().Set(
GRPC_ARG_SERVICE_CONFIG,
"{\n"
" \"methodConfig\": [ {\n"
" \"name\": [\n"
" { \"service\": \"service\", \"method\": \"method\" }\n"
" ],\n"
" \"timeout\": \"5s\"\n"
" } ]\n"
"}"));
absl::StrCat(
"{\n"
" \"methodConfig\": [ {\n"
" \"name\": [\n"
" { \"service\": \"service\", \"method\": \"method\" }\n"
" ],\n"
" \"timeout\": \"",
5 * grpc_test_slowdown_factor(),
"s\"\n"
" } ]\n"
"}")));
CancelAfterRoundTrip(*this, std::make_unique<DeadlineCancellationMode>(),
Duration::Infinity());
}

Loading…
Cancel
Save