Skip to content

Commit

Permalink
Fixed ParallelStreamSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Dec 18, 2024
1 parent 2568e06 commit 70250b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/jvm/src/test/scala/spec/ParallelStreamSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ class ParallelStreamSpec extends AnyWordSpec with Matchers {
Task(i * 2)
}
val task = stream.toList
task.sync() should be(List(2, 4, 6, 8, 10))
task.sync().sorted should be(List(2, 4, 6, 8, 10))
}
"correctly toList with random sleeps" in {
val stream = Stream.emits(List(1, 2, 3, 4, 5)).par() { i =>
Task.sleep((Math.random() * 1000).toInt.millis).map(_ => i * 2)
}
val task = stream.toList
task.sync() should be(List(2, 4, 6, 8, 10))
task.sync().sorted should be(List(2, 4, 6, 8, 10))
}
"correctly toList with random sleeps and overflowing maxBuffer" in {
val stream = Stream.emits(0 until 100_000).par(maxBuffer = 100) { i =>
Expand Down

0 comments on commit 70250b2

Please sign in to comment.