-
Notifications
You must be signed in to change notification settings - Fork 603
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
return empty stream if topic is closed #3085
Conversation
_ <- topic.subscribeUnbounded.compile.drain | ||
} yield () | ||
|
||
program.timeout(5.seconds) // will timeout if program is deadlocked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a timeout we should use executeEmbed
.
https://github.com/typelevel/cats-effect/blob/8ba8916407eb8f35fbffae76f72dac48d2dc7357/testkit/shared/src/main/scala/cats/effect/testkit/TestControl.scala#L397-L416
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks. executeEmbed
does work. I tried execute
with tickAll
and isDeadlocked
but that didn't work for me so I assumed executeEmbed
would have the same problem, but apparently not... I'm probably misinterpreting what tickAll
does then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isDeadlocked
returns true
if there is no more work scheduled.
https://github.com/typelevel/cats-effect/blob/8ba8916407eb8f35fbffae76f72dac48d2dc7357/testkit/shared/src/main/scala/cats/effect/testkit/TestControl.scala#L270-L276
However, this might be because the results
are already available, which I believe is the case here.
https://github.com/typelevel/cats-effect/blob/8ba8916407eb8f35fbffae76f72dac48d2dc7357/testkit/shared/src/main/scala/cats/effect/testkit/TestControl.scala#L127
I wonder if isDeadlocked
should check that as well.
program.timeout(5.seconds) // will timeout if program is deadlocked | ||
TestControl.executeEmbed(program) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think the comment about testing for deadlock is still helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Closes #3083.