From 69c0b02e255775d9a1d12fd3b0743662dae35437 Mon Sep 17 00:00:00 2001 From: dantb Date: Thu, 21 Sep 2023 10:05:59 +0200 Subject: [PATCH] Timeout Stream in tests --- .../epfl/bluebrain/nexus/testkit/archive/ArchiveHelpers.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/archive/ArchiveHelpers.scala b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/archive/ArchiveHelpers.scala index c0e261b57f..3f1720e02b 100644 --- a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/archive/ArchiveHelpers.scala +++ b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/archive/ArchiveHelpers.scala @@ -13,6 +13,7 @@ import org.scalatest.concurrent.ScalaFutures import java.nio.file.{Files => JFiles} import scala.concurrent.ExecutionContext +import scala.concurrent.duration._ import java.security.MessageDigest @@ -35,7 +36,7 @@ trait ArchiveHelpers extends ScalaFutures with EitherValuable with OptionValues def fromZip(source: Source[ByteString, Any])(implicit m: Materializer, e: ExecutionContext): ArchiveContent = { val path = JFiles.createTempFile("test", ".zip") - source.runWith(FileIO.toPath(path)).futureValue + source.completionTimeout(10.seconds).runWith(FileIO.toPath(path)).futureValue val result = Archive .zipReader(path.toFile) .mapAsync(1) { case (metadata, source) =>