Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slower sleep+timeout for timed doctest #3188

Merged
merged 5 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/shared/src/main/scala/fs2/Stream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4723,17 +4723,17 @@ object Stream extends StreamLowPriority {
*
* As a quick example, let's write a timed pull which emits the
* string "late!" whenever a chunk of the stream is not emitted
* within 450 milliseconds:
* within 1 second:
*
* @example {{{
* scala> import cats.effect.IO
* scala> import cats.effect.unsafe.implicits.global
* scala> import scala.concurrent.duration._
* scala> val s = (Stream("elem") ++ Stream.sleep_[IO](600.millis)).repeat.take(3)
* scala> val s = (Stream("elem") ++ Stream.sleep_[IO](1500.millis)).repeat.take(3)
* scala> s.pull
* | .timed { timedPull =>
* | def go(timedPull: Pull.Timed[IO, String]): Pull[IO, String, Unit] =
* | timedPull.timeout(450.millis) >> // starts new timeout and stops the previous one
* | timedPull.timeout(1.second) >> // starts new timeout and stops the previous one
* | timedPull.uncons.flatMap {
* | case Some((Right(elems), next)) => Pull.output(elems) >> go(next)
* | case Some((Left(_), next)) => Pull.output1("late!") >> go(next)
Expand Down
2 changes: 1 addition & 1 deletion io/jvm/src/test/scala/fs2/io/file/WatcherSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class WatcherSuite extends Fs2Suite with BaseFileSuite {
}

private def smallDelay: Stream[IO, Nothing] =
Stream.sleep_[IO](100.millis)
Stream.sleep_[IO](1.second)

// Tries to load the Oracle specific SensitivityWatchEventModifier to increase sensitivity of polling
private val modifiers: Seq[WatchEvent.Modifier] =
Expand Down