From 8b0934795036154dd4d835ea30770bc0b86243a9 Mon Sep 17 00:00:00 2001 From: janakr Date: Tue, 16 Jan 2018 14:15:09 -0800 Subject: Remove mtime field from FileStateValue. We stopped treating empty files specially in the execution phase after unknown commit. So this code is mostly if not entirely orphaned. The only scenario in which this would lead to a semantic difference that I can think of is if the user is running with --nouse_action_cache and a running Bazel server, and they have an action they want to re-run when an empty input file changes, which isn't something we need to be concerned about. PiperOrigin-RevId: 182109952 --- .../devtools/build/lib/skyframe/FileFunctionTest.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java') diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java index 052b59105a..0a0b460cd4 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java @@ -452,8 +452,6 @@ public class FileFunctionTest { p.setLastModifiedTime(0L); FileValue a = valueForPath(p); p.setLastModifiedTime(1L); - assertThat(valueForPath(p)).isNotEqualTo(a); - p.setLastModifiedTime(0L); assertThat(valueForPath(p)).isEqualTo(a); FileSystemUtils.writeContentAsLatin1(p, "content"); // Same digest, but now non-empty. @@ -471,7 +469,7 @@ public class FileFunctionTest { assertThat(value.getDigest()).isNull(); p.setLastModifiedTime(10L); - assertThat(valueForPath(p)).isNotEqualTo(value); + assertThat(valueForPath(p)).isEqualTo(value); p.setLastModifiedTime(0L); assertThat(valueForPath(p)).isEqualTo(value); @@ -498,16 +496,6 @@ public class FileFunctionTest { assertThat(value.getDigest()).isNotNull(); } - @Test - public void testFileModificationModTime() throws Exception { - fastDigest = false; - Path p = file("file"); - FileValue a = valueForPath(p); - p.setLastModifiedTime(42); - FileValue b = valueForPath(p); - assertThat(a.equals(b)).isFalse(); - } - @Test public void testFileModificationDigest() throws Exception { fastDigest = true; -- cgit v1.2.3