Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
  • Loading branch information
adisuissa committed Oct 23, 2024
1 parent 99ddb91 commit f8f61d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions source/common/config/xds_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ XdsManagerImpl::validateAdsConfig(const envoy::config::core::v3::ApiConfigSource
auto& validation_visitor = validation_context_.staticValidationVisitor();
TRY_ASSERT_MAIN_THREAD { MessageUtil::validate(config_source, validation_visitor); }
END_TRY
CATCH(const EnvoyException& e, {
return absl::InternalError(e.what());
});
CATCH(const EnvoyException& e, { return absl::InternalError(e.what()); });
return absl::OkStatus();
}

Expand Down
13 changes: 6 additions & 7 deletions test/integration/ads_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2890,7 +2890,7 @@ TEST_P(AdsReplacementIntegrationTest, AdipReplaceAdsConfig) {
// Expect a reset from the first xDS source.
EXPECT_TRUE(xds_stream_->waitForReset());

// Allow a connection to the seconds xDS source.
// Allow a connection to the second xDS source.
AssertionResult result =
second_xds_upstream_->waitForHttpConnection(*dispatcher_, second_xds_connection_);
RELEASE_ASSERT(result, result.message());
Expand All @@ -2916,23 +2916,22 @@ TEST_P(AdsReplacementIntegrationTest, AdipReplaceAdsConfig) {
Config::TypeUrl::get().Cluster, {buildCluster("replaced_cluster")},
{buildCluster("replaced_cluster")}, {}, "replaced1", {}, second_xds_stream_.get());

// Wait for an updated EDS request, and CDS ACK.
// Wait for an updated EDS request.
EXPECT_TRUE(compareDiscoveryRequest(Config::TypeUrl::get().ClusterLoadAssignment, "original1",
{"replaced_cluster"}, {"replaced_cluster"}, {}, false,
Grpc::Status::WellKnownGrpcStatus::Ok, "",
second_xds_stream_.get()));
EXPECT_TRUE(compareDiscoveryRequest(Config::TypeUrl::get().Cluster, "replaced1", {}, {}, {},
false, Grpc::Status::WellKnownGrpcStatus::Ok, "",
second_xds_stream_.get()));

// Send an EDS response.
sendDiscoveryResponse<envoy::config::endpoint::v3::ClusterLoadAssignment>(
Config::TypeUrl::get().ClusterLoadAssignment,
{buildClusterLoadAssignment("replaced_cluster")},
{buildClusterLoadAssignment("replaced_cluster")}, {}, "replaced1", {},
second_xds_stream_.get());

// Expect an EDS ACK.
// Wait for a CDS and EDS ACKs.
EXPECT_TRUE(compareDiscoveryRequest(Config::TypeUrl::get().Cluster, "replaced1", {}, {}, {},
false, Grpc::Status::WellKnownGrpcStatus::Ok, "",
second_xds_stream_.get()));
EXPECT_TRUE(compareDiscoveryRequest(
Config::TypeUrl::get().ClusterLoadAssignment, "replaced1", {"replaced_cluster_1"}, {}, {},
false, Grpc::Status::WellKnownGrpcStatus::Ok, "", second_xds_stream_.get()));
Expand Down

0 comments on commit f8f61d6

Please sign in to comment.