-
Couldn't load subscription status.
- Fork 1.4k
Make ZStream#aggregateAsyncWithin fail fast #4141
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
Conversation
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.
Great fix. I have a small concern about potential flakiness in the test. We can merge afterwards.
streams-tests/shared/src/test/scala/zio/stream/ZStreamSpec.scala
Outdated
Show resolved
Hide resolved
| value <- queue.takeAll | ||
| _ <- queue.shutdown | ||
| } yield assert(value)(equalTo(List(1, 2, 3, 4, 5))) | ||
| } @@ zioTag(errors), |
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.
Can you do a few runs with nonFlaky(50000) locally to verify the test is not flaky? Some parts of it (usage of TestClock with no advancing, use of takeAll which is not deterministic) make me a bit wary.
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.
I just ran it locally with nonFlaky(50000) ten times. No failures.
| sdriver <- schedule.driver.toManaged_ | ||
| lastChunk <- ZRef.makeManaged[Chunk[P]](Chunk.empty) | ||
| producer = Take.fromPull(pull).repeatWhileM(take => handoff.offer(take).as(!take.isDone)) | ||
| producer = Take.fromPull(pull).repeatWhileM(take => handoff.offer(take).as(take.isSuccess)) |
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.
Great fix 👍
5e9236a to
7a8967d
Compare
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.
Thank you @luis3m!
|
@iravid ready for review again |
Closes #4039