Skip to content

Commit

Permalink
Timeout Stream in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dantb committed Sep 21, 2023
1 parent 51e8eb4 commit 69c0b02
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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) =>
Expand Down

0 comments on commit 69c0b02

Please sign in to comment.