Skip to content

Commit

Permalink
[xds_client_test] remove now-unnecessary override of timer duration (g…
Browse files Browse the repository at this point in the history
…rpc#38357)

This should have been done as part of grpc#37668, but I missed it.

Closes grpc#38357

COPYBARA_INTEGRATE_REVIEW=grpc#38357 from markdroth:xds_client_test_remove_timeout_override ec8ac69
PiperOrigin-RevId: 710139258
  • Loading branch information
markdroth authored and copybara-github committed Dec 27, 2024
1 parent bbefef3 commit c4aa5c4
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions test/core/xds/xds_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -759,17 +759,15 @@ class XdsClientTest : public ::testing::Test {

// Sets transport_factory_ and initializes xds_client_ with the
// specified bootstrap config.
void InitXdsClient(
FakeXdsBootstrap::Builder bootstrap_builder = FakeXdsBootstrap::Builder(),
Duration resource_request_timeout = Duration::Seconds(15)) {
void InitXdsClient(FakeXdsBootstrap::Builder bootstrap_builder =
FakeXdsBootstrap::Builder()) {
transport_factory_ = MakeRefCounted<FakeXdsTransportFactory>(
[]() { FAIL() << "Multiple concurrent reads"; }, event_engine_);
auto metrics_reporter = std::make_unique<MetricsReporter>(event_engine_);
metrics_reporter_ = metrics_reporter.get();
xds_client_ = MakeRefCounted<XdsClient>(
bootstrap_builder.Build(), transport_factory_, event_engine_,
std::move(metrics_reporter), "foo agent", "foo version",
resource_request_timeout * grpc_test_slowdown_factor());
std::move(metrics_reporter), "foo agent", "foo version");
}

// Starts and cancels a watch for a Foo resource.
Expand Down Expand Up @@ -2420,9 +2418,7 @@ TEST_F(XdsClientTest, StreamClosedByServerWithoutSeeingResponse) {
}

TEST_F(XdsClientTest, ConnectionFails) {
// Lower resources-does-not-exist timeout, to make sure that we're not
// triggering that here.
InitXdsClient(FakeXdsBootstrap::Builder(), Duration::Seconds(3));
InitXdsClient();
// Tell transport to let us manually trigger completion of the
// send_message ops to XdsClient.
transport_factory_->SetAutoCompleteMessagesFromClient(false);
Expand Down Expand Up @@ -2516,7 +2512,7 @@ TEST_F(XdsClientTest, ConnectionFails) {
}

TEST_F(XdsClientTest, ResourceDoesNotExistUponTimeout) {
InitXdsClient(FakeXdsBootstrap::Builder(), Duration::Seconds(1));
InitXdsClient();
// Start a watch for "foo1".
auto watcher = StartFooWatch("foo1");
// Watcher should initially not see any resource reported.
Expand Down Expand Up @@ -2602,8 +2598,7 @@ TEST_F(XdsClientTest, ResourceDoesNotExistUponTimeout) {
}

TEST_F(XdsClientTest, ResourceDoesNotExistAfterStreamRestart) {
// Lower resources-does-not-exist timeout so test finishes faster.
InitXdsClient(FakeXdsBootstrap::Builder(), Duration::Seconds(3));
InitXdsClient();
// Metrics should initially be empty.
EXPECT_THAT(metrics_reporter_->resource_updates_valid(),
::testing::ElementsAre());
Expand Down Expand Up @@ -2717,9 +2712,7 @@ TEST_F(XdsClientTest, ResourceDoesNotExistAfterStreamRestart) {
}

TEST_F(XdsClientTest, DoesNotExistTimerNotStartedUntilSendCompletes) {
// Lower resources-does-not-exist timeout, to make sure that we're not
// triggering that here.
InitXdsClient(FakeXdsBootstrap::Builder(), Duration::Seconds(3));
InitXdsClient();
// Tell transport to let us manually trigger completion of the
// send_message ops to XdsClient.
transport_factory_->SetAutoCompleteMessagesFromClient(false);
Expand Down Expand Up @@ -2802,7 +2795,7 @@ TEST_F(XdsClientTest, DoesNotExistTimerNotStartedUntilSendCompletes) {
// update containing that resource.
TEST_F(XdsClientTest,
ResourceDoesNotExistUnsubscribeAndResubscribeWhileSendMessagePending) {
InitXdsClient(FakeXdsBootstrap::Builder(), Duration::Seconds(1));
InitXdsClient();
// Tell transport to let us manually trigger completion of the
// send_message ops to XdsClient.
transport_factory_->SetAutoCompleteMessagesFromClient(false);
Expand Down Expand Up @@ -2951,9 +2944,7 @@ TEST_F(XdsClientTest,
}

TEST_F(XdsClientTest, DoNotSendDoesNotExistForCachedResource) {
// Lower resources-does-not-exist timeout, to make sure that we're not
// triggering that here.
InitXdsClient(FakeXdsBootstrap::Builder(), Duration::Seconds(3));
InitXdsClient();
// Start a watch for "foo1".
auto watcher = StartFooWatch("foo1");
// Watcher should initially not see any resource reported.
Expand Down

0 comments on commit c4aa5c4

Please sign in to comment.