diff options
author | 2018-03-09 04:51:38 -0800 | |
---|---|---|
committer | 2018-03-09 04:53:21 -0800 | |
commit | a31e035fb42aa8db9fd248ef2ebd665a411053b8 (patch) | |
tree | d14b8813a8f2c30af5c871d035c7473dcfbd0f4f /src/main/java/com/google/devtools | |
parent | a278aec030ec67acc6c383e83364ce6062e59c11 (diff) |
tests: fix flaky RecursiveFSTraversalFunctionTest
Fix the testTraversalOfGeneratedDirectory method
in RecursiveFilesystemTraversalFunctionTest that
was flaky on Windows.
The fix is to wait so that changes to files in the
InMemoryFileSystem will have observable effects on
the file ctimes.
Depends on https://github.com/bazelbuild/bazel/pull/4787
Fixes https://github.com/bazelbuild/bazel/issues/4755
Closes #4788.
PiperOrigin-RevId: 188470080
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/util/io/TimestampGranularityMonitor.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/util/io/TimestampGranularityMonitor.java b/src/main/java/com/google/devtools/build/lib/util/io/TimestampGranularityMonitor.java index 82479b2078..954474130c 100644 --- a/src/main/java/com/google/devtools/build/lib/util/io/TimestampGranularityMonitor.java +++ b/src/main/java/com/google/devtools/build/lib/util/io/TimestampGranularityMonitor.java @@ -206,6 +206,11 @@ public class TimestampGranularityMonitor { waitForTimestampGranularity(outErr); } + /** Wait enough such that changes to a file with the given ctime will have observable effects. */ + public static void waitForTimestampGranularity(long ctimeMillis, Clock clock, OutErr outErr) { + new TimestampGranularityMonitor(clock).waitForTimestampGranularity(ctimeMillis, outErr); + } + /** * Rounds the specified time, in milliseconds, down to the nearest second, * and returns the result in milliseconds. |