Open
Conversation
Author
|
@AdamChlupacek Can you help me to figure out why these test are failing? |
To my understanding the tests fail because calling You can see it running this example in the REPL (i tried with fs2 import fs2._
import cats.effect.IO
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
implicit val cs = IO.contextShift(ExecutionContext.global)
implicit val ce = IO.ioConcurrentEffect
val source = Stream[IO, Int](1, 2, 3, 4, 5).covary[IO]
val program =
fs2.concurrent.Queue
.unbounded[IO, Int]
.flatMap { queue =>
(source.through(queue.enqueue).drain ++
queue.dequeue
.evalTap(el => IO(println(s"$el was in the queue")))
.takeThrough(_ < 3)
.evalTap(el => IO(println(s"$el was taken from the stream")))
.drain ++
Stream
.eval(queue.dequeue1)
.evalTap(el => IO(println(s"The queue still contains $el")))).compile.last
}
program.unsafeRunTimed(10.second).flattenThat will output something like Hope this helps! |
|
Main problem with early-terminated.drain test with fs 2.x.x is that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update to fs2 version 2.0.0
Two tests are currently failing:
I would be thankful for hints why this happens.