Skip to content

Commit

Permalink
[xds_client_test] remove now-unnecessary override of timer duration
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Dec 27, 2024
1 parent 6768331 commit d9f537d
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions test/core/xds/xds_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,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)) {
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 +2419,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 +2513,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 +2599,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 +2713,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 +2796,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 +2945,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 d9f537d

Please sign in to comment.