From 2b94436bc862f665d2ffb3a84ebcba1c90529f02 Mon Sep 17 00:00:00 2001 From: Jorge Vicente Cantero Date: Fri, 23 Nov 2018 11:09:36 +0100 Subject: [PATCH] Sleep in `FileWatchingSpec` to avoids spurious CI errors --- frontend/src/test/scala/bloop/engine/FileWatchingSpec.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/test/scala/bloop/engine/FileWatchingSpec.scala b/frontend/src/test/scala/bloop/engine/FileWatchingSpec.scala index 36be80da8e..c361fd5d64 100644 --- a/frontend/src/test/scala/bloop/engine/FileWatchingSpec.scala +++ b/frontend/src/test/scala/bloop/engine/FileWatchingSpec.scala @@ -138,6 +138,7 @@ class FileWatchingSpec { val existingSourceDir = project.sources.collectFirst { case d if d.exists => d }.get val newSource = existingSourceDir.resolve("D.scala") if (Files.exists(newSource.underlying)) delete(newSource) + Thread.sleep(50) val runTest = TestUtil.interpreterTask(commandToRun, state) val testFuture = runTest.runAsync(ExecutionContext.scheduler) @@ -149,10 +150,12 @@ class FileWatchingSpec { // Write the contents of a source back to the same source and force another test execution //Files.write(singleFile.underlying, "object Hello".getBytes("UTF-8")) Files.write(newSource.underlying, "object ForceRecompilation {}".getBytes("UTF-8")) + Thread.sleep(50) isIterationOver(observable, 2).flatMap { _ => // Write the contents of a source back to the same source and force another test execution Files.write(singleFile.underlying, "object ForceRecompilation2 {}".getBytes("UTF-8")) + Thread.sleep(50) isIterationOver(observable, 3).map { _ => testFuture.cancel()