[XdsEnd2EndTest] Use Custom RPC Options for each test to reduce test run times (#37679)

Also, add status expectations for tests where we expect failures.

Closes #37679

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37679 from yashykt:CustomRpcOptions 75272d542e
PiperOrigin-RevId: 674042498
pull/37718/head
Yash Tibrewal 2 months ago committed by Copybara-Service
parent a38034d770
commit cdb22f1fd0
  1. 17
      src/core/server/xds_server_config_fetcher.cc
  2. 498
      test/cpp/end2end/xds/xds_end2end_test.cc
  3. 15
      test/cpp/end2end/xds/xds_end2end_test_lib.cc
  4. 4
      test/cpp/end2end/xds/xds_end2end_test_lib.h

@ -677,8 +677,16 @@ void XdsServerConfigFetcher::ListenerWatcher::
// It should get cleaned up eventually. Ignore this update. // It should get cleaned up eventually. Ignore this update.
return; return;
} }
bool first_good_update = filter_chain_match_manager_ == nullptr;
// Promote the pending FilterChainMatchManager
filter_chain_match_manager_ = std::move(pending_filter_chain_match_manager_);
// TODO(yashykt): Right now, the server_config_watcher_ does not invoke
// XdsServerConfigFetcher while holding a lock, but that might change in the
// future in which case we would want to execute this update outside the
// critical region through a WorkSerializer similar to XdsClient.
server_config_watcher_->UpdateConnectionManager(filter_chain_match_manager_);
// Let the logger know about the update if there was no previous good update. // Let the logger know about the update if there was no previous good update.
if (filter_chain_match_manager_ == nullptr) { if (first_good_update) {
if (serving_status_notifier_.on_serving_status_update != nullptr) { if (serving_status_notifier_.on_serving_status_update != nullptr) {
serving_status_notifier_.on_serving_status_update( serving_status_notifier_.on_serving_status_update(
serving_status_notifier_.user_data, listening_address_.c_str(), serving_status_notifier_.user_data, listening_address_.c_str(),
@ -688,13 +696,6 @@ void XdsServerConfigFetcher::ListenerWatcher::
<< listening_address_; << listening_address_;
} }
} }
// Promote the pending FilterChainMatchManager
filter_chain_match_manager_ = std::move(pending_filter_chain_match_manager_);
// TODO(yashykt): Right now, the server_config_watcher_ does not invoke
// XdsServerConfigFetcher while holding a lock, but that might change in the
// future in which case we would want to execute this update outside the
// critical region through a WorkSerializer similar to XdsClient.
server_config_watcher_->UpdateConnectionManager(filter_chain_match_manager_);
} }
// //

File diff suppressed because it is too large Load Diff

@ -843,11 +843,26 @@ std::string XdsEnd2endTest::MakeConnectionFailureRegex(
"(Connection refused" "(Connection refused"
"|Connection reset by peer" "|Connection reset by peer"
"|Socket closed" "|Socket closed"
"|Broken pipe"
"|FD shutdown)" "|FD shutdown)"
// errno value // errno value
"( \\([0-9]+\\))?"); "( \\([0-9]+\\))?");
} }
std::string XdsEnd2endTest::MakeTlsHandshakeFailureRegex(
absl::string_view prefix) {
return absl::StrCat(
prefix,
"(UNKNOWN|UNAVAILABLE): "
// IP address
"(ipv6:%5B::1%5D|ipv4:127.0.0.1):[0-9]+: "
// Prefixes added for context
"(Failed to connect to remote host: )?"
// Tls handshake failure
"Tls handshake failed \\(TSI_PROTOCOL_FAILURE\\): SSL_ERROR_SSL: "
"error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED");
}
grpc_core::PemKeyCertPairList XdsEnd2endTest::ReadTlsIdentityPair( grpc_core::PemKeyCertPairList XdsEnd2endTest::ReadTlsIdentityPair(
const char* key_path, const char* cert_path) { const char* key_path, const char* cert_path) {
return grpc_core::PemKeyCertPairList{grpc_core::PemKeyCertPair( return grpc_core::PemKeyCertPairList{grpc_core::PemKeyCertPair(

@ -966,6 +966,10 @@ class XdsEnd2endTest : public ::testing::TestWithParam<XdsTestType>,
// message for a connection failure. // message for a connection failure.
static std::string MakeConnectionFailureRegex(absl::string_view prefix); static std::string MakeConnectionFailureRegex(absl::string_view prefix);
// Returns a regex that can be matched against an RPC failure status
// message for a Tls handshake failure.
static std::string MakeTlsHandshakeFailureRegex(absl::string_view prefix);
// Returns a private key pair, read from local files. // Returns a private key pair, read from local files.
static grpc_core::PemKeyCertPairList ReadTlsIdentityPair( static grpc_core::PemKeyCertPairList ReadTlsIdentityPair(
const char* key_path, const char* cert_path); const char* key_path, const char* cert_path);

Loading…
Cancel
Save