Skip to content

Commit

Permalink
Fix tsl/platform/cloud:curl_http_request_test after breakage
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 678538860
  • Loading branch information
ddunl authored and copybara-github committed Sep 25, 2024
1 parent 7c709a2 commit 8c1310a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tsl/platform/cloud/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,14 @@ tsl_cc_test(
srcs = ["curl_http_request_test.cc"],
deps = [
":curl_http_request",
"//tsl/platform",
"//tsl/platform:env_impl",
"//tsl/platform:path",
"//tsl/platform:platform_port",
"//tsl/platform:test",
"//tsl/platform:test_main",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@xla//xla/tsl/lib/core:status_test_util",
],
)
Expand Down
10 changes: 7 additions & 3 deletions tsl/platform/cloud/curl_http_request_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ limitations under the License.
#include <string>

#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "xla/tsl/lib/core/status_test_util.h"
#include "tsl/platform/mem.h"
#include "tsl/platform/path.h"
#include "tsl/platform/platform.h"
#include "tsl/platform/test.h"

namespace tsl {
Expand Down Expand Up @@ -495,9 +497,11 @@ TEST(CurlHttpRequestTest, GetRequest_CouldntResolveHost) {
const auto& status = http_request.Send();
EXPECT_EQ(error::FAILED_PRECONDITION, status.code());
EXPECT_EQ(
"Error executing an HTTP request: libcurl code 6 meaning "
"'Could not resolve hostname', error details: Could not resolve host "
"'metadata'",
absl::StrCat(
"Error executing an HTTP request: libcurl code 6 meaning ",
(kIsOpenSource ? "'Couldn't resolve host name', error details: "
: "'Could not resolve hostname', error details: "),
"Could not resolve host ", "'metadata'"),
status.message());
EXPECT_EQ(0, http_request.GetResponseCode());
}
Expand Down

0 comments on commit 8c1310a

Please sign in to comment.