aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/platform/cloud/gcs_file_system_test.cc
diff options
context:
space:
mode:
authorGravatar Michael Case <mikecase@google.com>2017-10-06 13:52:17 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-06 13:56:02 -0700
commit30c5f4347b722961a40eab483f2391a92d9088bb (patch)
tree3ae6169d4b0678cb5c0519554e6a27401f616552 /tensorflow/core/platform/cloud/gcs_file_system_test.cc
parent2a90713ef70f01392ac59899ca92376549c57126 (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.cc4
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);