[e2e tests] fix regex for connection failures to catch a missed case (#36969)

Closes #36969

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36969 from markdroth:e2e_test_regex_fix 043e5fdadb
PiperOrigin-RevId: 644540986
pull/35773/head
Mark D. Roth 5 months ago committed by Copybara-Service
parent 8dac453a71
commit 22322fe7df
  1. 33
      test/cpp/end2end/client_lb_end2end_test.cc
  2. 33
      test/cpp/end2end/xds/xds_end2end_test_lib.cc

@ -580,22 +580,23 @@ class ClientLbEnd2endTest : public ::testing::Test {
}
static std::string MakeConnectionFailureRegex(absl::string_view prefix) {
return absl::StrCat(prefix,
"; last error: (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: )?"
"(Timeout occurred: )?"
// Syscall
"((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message
"(Connection refused"
"|Connection reset by peer"
"|Socket closed"
"|FD shutdown)"
// errno value
"( \\([0-9]+\\))?");
return absl::StrCat(
prefix,
"; last error: (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: )?"
"(Timeout occurred: )?"
// Syscall
"((connect|sendmsg|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message
"(Connection refused"
"|Connection reset by peer"
"|Socket closed"
"|FD shutdown)"
// errno value
"( \\([0-9]+\\))?");
}
const std::string server_host_;

@ -836,22 +836,23 @@ void XdsEnd2endTest::SetProtoDuration(
std::string XdsEnd2endTest::MakeConnectionFailureRegex(
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: )?"
"(Timeout occurred: )?"
// Syscall
"((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message
"(Connection refused"
"|Connection reset by peer"
"|Socket closed"
"|FD shutdown)"
// errno value
"( \\([0-9]+\\))?");
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: )?"
"(Timeout occurred: )?"
// Syscall
"((connect|sendmsg|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message
"(Connection refused"
"|Connection reset by peer"
"|Socket closed"
"|FD shutdown)"
// errno value
"( \\([0-9]+\\))?");
}
grpc_core::PemKeyCertPairList XdsEnd2endTest::ReadTlsIdentityPair(

Loading…
Cancel
Save