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

fix: Improved the isTerminated semantics to be based on the ActorCell instead of the Mailbox #31

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: Added back the overriden test
  • Loading branch information
Massimo Saliba committed Nov 5, 2024
commit bdc69992097f9ce30f3bf3727d89867d16956fa5
17 changes: 17 additions & 0 deletions src/test/scala/com/suprnation/actor/test/TestKitSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,23 @@ class TestKitSpec extends AsyncFlatSpec with Matchers with TestKit {
}
}

"receiveWhile" should "stop without error when timeout is exceeded" in {
testActorSystem { case (_, actorRef) =>
for {
_ <- actorRef ! "Bye"
_ <- actorRef ! "Bye"
_ <- actorRef ! "Bye"

receivedMessage <- receiveWhile(actorRef, 1 second) { case s: String =>
s
}
} yield {
receivedMessage should have size 3
receivedMessage should contain theSameElementsAs Vector("Bye", "Bye", "Bye")
}
}
}

"within" should "raise exception when code block takes longer than max time" in {
testActorSystem(Actor.withReceive[IO, Any] { case s =>
IO.sleep(400 millis).as(s)
Expand Down
Loading