diff options
author | 2017-10-06 13:52:17 -0700 | |
---|---|---|
committer | 2017-10-06 13:56:02 -0700 | |
commit | 30c5f4347b722961a40eab483f2391a92d9088bb (patch) | |
tree | 3ae6169d4b0678cb5c0519554e6a27401f616552 /tensorflow/core/platform/cloud/gcs_file_system_test.cc | |
parent | 2a90713ef70f01392ac59899ca92376549c57126 (diff) |
Fix float32 precision causing test failure in gcs cloud TF tests.
The time in nanoseconds was being cast to float32 which caused loss
of precision. Because floats are used when parsing the time, the time
calculation can still be rounded incorrectly. Also changing EXPECT_EQ
to EXPECT_NEAR(,,1).
PiperOrigin-RevId: 171338952
Diffstat (limited to 'tensorflow/core/platform/cloud/gcs_file_system_test.cc')
-rw-r--r-- | tensorflow/core/platform/cloud/gcs_file_system_test.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/core/platform/cloud/gcs_file_system_test.cc b/tensorflow/core/platform/cloud/gcs_file_system_test.cc index b8573e335d..911176365f 100644 --- a/tensorflow/core/platform/cloud/gcs_file_system_test.cc +++ b/tensorflow/core/platform/cloud/gcs_file_system_test.cc @@ -1637,7 +1637,7 @@ TEST(GcsFileSystemTest, Stat_Object) { FileStatistics stat; TF_EXPECT_OK(fs.Stat("gs://bucket/file.txt", &stat)); EXPECT_EQ(1010, stat.length); - EXPECT_EQ(1461971724896, stat.mtime_nsec / 1000 / 1000); + EXPECT_NEAR(1461971724896, stat.mtime_nsec / 1000 / 1000, 1); EXPECT_FALSE(stat.is_directory); } @@ -1771,7 +1771,7 @@ TEST(GcsFileSystemTest, Stat_Cache) { FileStatistics stat; TF_EXPECT_OK(fs.Stat("gs://bucket/file.txt", &stat)); EXPECT_EQ(1010, stat.length); - EXPECT_EQ(1461971724896, stat.mtime_nsec / 1000 / 1000); + EXPECT_NEAR(1461971724896, stat.mtime_nsec / 1000 / 1000, 1); EXPECT_FALSE(stat.is_directory); TF_EXPECT_OK(fs.Stat("gs://bucket/subfolder", &stat)); EXPECT_EQ(0, stat.length); |