diff options
author | 2017-12-19 07:12:25 -0800 | |
---|---|---|
committer | 2017-12-19 07:13:52 -0800 | |
commit | c801c393bcfabbe6e5058fd77ef2d67660c75da3 (patch) | |
tree | 1711325efe0f0e0fa9adb6d2aef8310a666e587b /src/test/java/com/google/devtools/build/lib/actions | |
parent | 2918e78a2b3144d5cacc1ab20ab4626a72df797a (diff) |
Automated rollback of commit 82e68b75304438c96ff878a0c2b8d18b42002486.
Fixes #4322, #4306.
*** Reason for rollback ***
Introduces a deadlock (see https://github.com/bazelbuild/bazel/issues/4322)
*** Original change description ***
Make FileSystem operate on LocalPath instead of Path.
PiperOrigin-RevId: 179549866
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/actions')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/actions/DigestUtilsTest.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/DigestUtilsTest.java b/src/test/java/com/google/devtools/build/lib/actions/DigestUtilsTest.java index 6fee2c1061..259e0f2088 100644 --- a/src/test/java/com/google/devtools/build/lib/actions/DigestUtilsTest.java +++ b/src/test/java/com/google/devtools/build/lib/actions/DigestUtilsTest.java @@ -25,7 +25,6 @@ import com.google.devtools.build.lib.testutil.TestUtils; import com.google.devtools.build.lib.vfs.FileSystem; import com.google.devtools.build.lib.vfs.FileSystem.HashFunction; import com.google.devtools.build.lib.vfs.FileSystemUtils; -import com.google.devtools.build.lib.vfs.LocalPath; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem; import java.io.IOException; @@ -59,7 +58,7 @@ public class DigestUtilsTest { FileSystem myfs = new InMemoryFileSystem(BlazeClock.instance(), hf) { @Override - protected byte[] getDigest(LocalPath path, HashFunction hashFunction) throws IOException { + protected byte[] getDigest(Path path, HashFunction hashFunction) throws IOException { try { barrierLatch.countDown(); readyLatch.countDown(); @@ -73,8 +72,7 @@ public class DigestUtilsTest { } @Override - protected byte[] getFastDigest(LocalPath path, HashFunction hashFunction) - throws IOException { + protected byte[] getFastDigest(Path path, HashFunction hashFunction) throws IOException { return fastDigest ? super.getDigest(path, hashFunction) : null; } }; @@ -133,7 +131,7 @@ public class DigestUtilsTest { FileSystem myFS = new InMemoryFileSystem(BlazeClock.instance(), hf) { @Override - protected byte[] getFastDigest(LocalPath path, HashFunction hashFunction) + protected byte[] getFastDigest(Path path, HashFunction hashFunction) throws IOException { // Digest functions have more than 3 bytes, usually at least 16. return malformed; @@ -141,7 +139,6 @@ public class DigestUtilsTest { }; Path path = myFS.getPath("/file"); FileSystemUtils.writeContentAsLatin1(path, "a"); - byte[] result = DigestUtils.getDigestOrFail(path, 1); assertThat(result).isEqualTo(path.getDigest()); assertThat(result).isNotSameAs(malformed); @@ -224,14 +221,13 @@ public class DigestUtilsTest { FileSystem tracingFileSystem = new InMemoryFileSystem(BlazeClock.instance()) { @Override - protected byte[] getFastDigest(LocalPath path, HashFunction hashFunction) - throws IOException { + protected byte[] getFastDigest(Path path, HashFunction hashFunction) throws IOException { getFastDigestCounter.incrementAndGet(); return null; } @Override - protected byte[] getDigest(LocalPath path, HashFunction hashFunction) throws IOException { + protected byte[] getDigest(Path path, HashFunction hashFunction) throws IOException { getDigestCounter.incrementAndGet(); return super.getDigest(path, hashFunction); } |