From ed44e74a9fdf8974b22638be86353c510d99302d Mon Sep 17 00:00:00 2001 From: dantb Date: Thu, 21 Sep 2023 10:29:22 +0200 Subject: [PATCH] Timeout file stream future in tests --- .../bluebrain/nexus/testkit/archive/ArchiveHelpers.scala | 8 +++++++- 1 file changed, 7 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 3f1720e02b..e65d69497a 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 @@ -16,6 +16,9 @@ import scala.concurrent.ExecutionContext import scala.concurrent.duration._ import java.security.MessageDigest +import org.scalatest.concurrent.PatienceConfiguration +import org.scalatest.time.Span +import org.scalatest.time.Seconds trait ArchiveHelpers extends ScalaFutures with EitherValuable with OptionValues { @@ -36,7 +39,10 @@ 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.completionTimeout(10.seconds).runWith(FileIO.toPath(path)).futureValue + source + .completionTimeout(10.seconds) + .runWith(FileIO.toPath(path)) + .futureValue(PatienceConfiguration.Timeout(Span(10, Seconds))) val result = Archive .zipReader(path.toFile) .mapAsync(1) { case (metadata, source) =>