diff options
author | 2018-07-02 01:00:16 -0700 | |
---|---|---|
committer | 2018-07-02 01:01:25 -0700 | |
commit | 0e3df78b0b4f5af22a5c38980465fde87cc929ad (patch) | |
tree | d66d2f22e4a8973351b39e9879ba0f6afb926eee /src/test | |
parent | 417260d2d3d5f8d264473c19f0c7c798f71adffe (diff) |
Relax the threshold for calling getDigestInExclusiveMode().
If the policy goal is to minimize disk seeks, this should be equally good.
Second attempt, with test update.
RELNOTES: None.
PiperOrigin-RevId: 202907857
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/actions/DigestUtilsTest.java | 19 |
1 files changed, 10 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 e4609416bd..1013c1a02e 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 @@ -115,19 +115,20 @@ public class DigestUtilsTest { } /** - * Ensures that digest calculation is synchronized for files - * greater than 4096 bytes if the digest is not available cheaply, - * so machines with rotating drives don't become unusable. + * Ensures that digest calculation is synchronized for files greater than + * {@link DigestUtils#MULTI_THREADED_DIGEST_MAX_FILE_SIZE} bytes if the digest is not + * available cheaply, so machines with rotating drives don't become unusable. */ @Test public void testCalculationConcurrency() throws Exception { + final int small = DigestUtils.MULTI_THREADED_DIGEST_MAX_FILE_SIZE; + final int large = DigestUtils.MULTI_THREADED_DIGEST_MAX_FILE_SIZE + 1; for (DigestHashFunction hf : Arrays.asList(DigestHashFunction.MD5, DigestHashFunction.SHA1)) { - assertDigestCalculationConcurrency(true, true, 4096, 4096, hf); - assertDigestCalculationConcurrency(true, true, 4097, 4097, hf); - assertDigestCalculationConcurrency(true, false, 4096, 4096, hf); - assertDigestCalculationConcurrency(false, false, 4097, 4097, hf); - assertDigestCalculationConcurrency(true, false, 1024, 4097, hf); - assertDigestCalculationConcurrency(true, false, 1024, 1024, hf); + assertDigestCalculationConcurrency(true, true, small, small, hf); + assertDigestCalculationConcurrency(true, true, large, large, hf); + assertDigestCalculationConcurrency(true, false, small, small, hf); + assertDigestCalculationConcurrency(true, false, small, large, hf); + assertDigestCalculationConcurrency(false, false, large, large, hf); } } |