[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. 5
      test/cpp/end2end/client_lb_end2end_test.cc
  2. 5
      test/cpp/end2end/xds/xds_end2end_test_lib.cc

@ -580,7 +580,8 @@ class ClientLbEnd2endTest : public ::testing::Test {
} }
static std::string MakeConnectionFailureRegex(absl::string_view prefix) { static std::string MakeConnectionFailureRegex(absl::string_view prefix) {
return absl::StrCat(prefix, return absl::StrCat(
prefix,
"; last error: (UNKNOWN|UNAVAILABLE): " "; last error: (UNKNOWN|UNAVAILABLE): "
// IP address // IP address
"(ipv6:%5B::1%5D|ipv4:127.0.0.1):[0-9]+: " "(ipv6:%5B::1%5D|ipv4:127.0.0.1):[0-9]+: "
@ -588,7 +589,7 @@ class ClientLbEnd2endTest : public ::testing::Test {
"(Failed to connect to remote host: )?" "(Failed to connect to remote host: )?"
"(Timeout occurred: )?" "(Timeout occurred: )?"
// Syscall // Syscall
"((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?" "((connect|sendmsg|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message // strerror() output or other message
"(Connection refused" "(Connection refused"
"|Connection reset by peer" "|Connection reset by peer"

@ -836,7 +836,8 @@ void XdsEnd2endTest::SetProtoDuration(
std::string XdsEnd2endTest::MakeConnectionFailureRegex( std::string XdsEnd2endTest::MakeConnectionFailureRegex(
absl::string_view prefix) { absl::string_view prefix) {
return absl::StrCat(prefix, return absl::StrCat(
prefix,
"(UNKNOWN|UNAVAILABLE): " "(UNKNOWN|UNAVAILABLE): "
// IP address // IP address
"(ipv6:%5B::1%5D|ipv4:127.0.0.1):[0-9]+: " "(ipv6:%5B::1%5D|ipv4:127.0.0.1):[0-9]+: "
@ -844,7 +845,7 @@ std::string XdsEnd2endTest::MakeConnectionFailureRegex(
"(Failed to connect to remote host: )?" "(Failed to connect to remote host: )?"
"(Timeout occurred: )?" "(Timeout occurred: )?"
// Syscall // Syscall
"((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?" "((connect|sendmsg|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message // strerror() output or other message
"(Connection refused" "(Connection refused"
"|Connection reset by peer" "|Connection reset by peer"

Loading…
Cancel
Save