-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ZStream.tapSink, either a flaky test or flaky implementation #8792
Labels
Comments
/bounty $100 to fix the test or implementation |
💎 $100 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio! Add a bounty • Share on socials
|
/attempt #8792
|
/attempt #8792
|
💡 @varshith257 submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
@kpritam: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've encountered this failure on my local env (saw it once, wasn't able to reproduce):
I suspect the issue depends on
ZStream.tapSink
's guarantees in face of downstream cancellation;If it guarantees that all emitted values were processed by the sink as well this is a real bug,
on the other hand if this is not guaranteed then this test is flaky as it cannot expect all values to have been processed by the sink (it can be relaxed to actually asset what its name suggests).
looking at
ZStream.tapSink
's implementation it seems to me that once downstream completes themerge
will also be halted, this effectively means interrupting both sides of the merge (if still running) which is done by fiber interruption. since there's no guarantee which one is interrupted first the ensuring block intapSink
can't guarantee proper completion of the sink.I was able to show this with an awkward test:
the test is awkward since it's expected to halt (if tapSink's guarantee is strong enough), instead it explicitly fails when the stream execution completes.
The text was updated successfully, but these errors were encountered: