Fix windows test.

The problem was that LocalTempFilename returns a full path, not just a basename, so we were joining two full paths, which doesn't work on Windows.

PiperOrigin-RevId: 324094697
Change-Id: I563f692ba6525097c95fda2a45ee9d565ac9c8a1
This commit is contained in:
Andrew Audibert 2020-07-30 15:21:18 -07:00 committed by TensorFlower Gardener
parent 56bb1ccfaa
commit 26c01423d9
2 changed files with 3 additions and 4 deletions

View File

@ -176,7 +176,6 @@ cc_library(
tf_cc_test(
name = "journal_test",
srcs = ["journal_test.cc"],
tags = ["no_windows"], # b/162268597
deps = [
":common_proto_cc",
":journal",

View File

@ -29,11 +29,11 @@ namespace {
using ::testing::HasSubstr;
bool NewJournalDir(std::string* journal_dir) {
std::string filename;
if (!Env::Default()->LocalTempFilename(&filename)) {
std::string filename = testing::TmpDir();
if (!Env::Default()->CreateUniqueFileName(&filename, "journal_dir")) {
return false;
}
*journal_dir = io::JoinPath(testing::TmpDir(), filename);
*journal_dir = filename;
return true;
}