Skip to content

Commit

Permalink
Sleep in FileWatchingSpec to avoids spurious CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jvican committed Nov 23, 2018
1 parent 336d693 commit 2b94436
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/test/scala/bloop/engine/FileWatchingSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 2b94436

Please sign in to comment.