Skip to content

Commit

Permalink
Propagate debugger failure on action error
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Żarnowski committed Dec 4, 2019
1 parent 89326ce commit 735ac3b
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -55,10 +55,13 @@ final class TestDebugger(connect: RemoteServer.Listener => Debugger)(
} yield ()
}

def awaitOutput(prefix: String, seconds: Int = 30): Future[Unit] = {
def awaitOutput(prefix: String, seconds: Int = 90): Future[Unit] = {
import org.eclipse.lsp4j.debug.{OutputEventArgumentsCategory => Category}
ifNotFailed(output.awaitPrefix(Category.STDOUT, prefix))
.withTimeout(seconds, TimeUnit.SECONDS)
ifNotFailed {
output
.awaitPrefix(Category.STDOUT, prefix)
.withTimeout(seconds, TimeUnit.SECONDS)
}
}

def allOutput: Future[String] = {
Expand Down Expand Up @@ -89,6 +92,7 @@ final class TestDebugger(connect: RemoteServer.Listener => Debugger)(
case None =>
action.andThen {
case Failure(error) => // fail when the action fails
failure.foreach(error.addSuppressed)
fail(error)
Future.failed(error)
case Success(value) =>
Expand Down

0 comments on commit 735ac3b

Please sign in to comment.