Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@guizmaii
Copy link
Member

@guizmaii guizmaii commented Jul 30, 2025

I didn't manage to add a case for a fatal error as I didn't manage to cactch the fatal error. No idea why

Needed for: #10060

@guizmaii guizmaii self-assigned this Jul 30, 2025
@guizmaii guizmaii marked this pull request as draft July 30, 2025 07:42
@guizmaii guizmaii force-pushed the opt_ZStream_fromIterator_0 branch from 69c9ff5 to 721902a Compare July 30, 2025 07:46
@guizmaii guizmaii marked this pull request as ready for review July 30, 2025 07:47
@hearnadam
Copy link
Collaborator

I didn't manage to add a case for a fatal error as I didn't manage to cactch the fatal error. No idea why

Fatal errors should not be caught. IsFatal ensures that the error channel never contains these errors.

@guizmaii guizmaii force-pushed the opt_ZStream_fromIterator_0 branch from 721902a to a6b4998 Compare July 30, 2025 21:16
@guizmaii guizmaii marked this pull request as draft July 30, 2025 21:16
@guizmaii guizmaii force-pushed the opt_ZStream_fromIterator_0 branch from a6b4998 to 147ec9c Compare July 30, 2025 21:17
@guizmaii guizmaii marked this pull request as ready for review July 30, 2025 21:32
}
},
test("handles exceptions from iterator") {
check(Gen.small(Gen.const(_), min = 1)) { maxChunkSize =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do either of these tests need Gen?

Copy link
Member Author

@guizmaii guizmaii Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is different when maxChunkSize == 1 and maxChunkSize > 1 so it needs to test these 2 cases, which justifies the usage of Gen.

It's copied from the initial test testing fromIterator

hearnadam
hearnadam previously approved these changes Jul 30, 2025
Comment on lines 5633 to 5637
def failingIterator = {
throw exception

List(1, 2).iterator
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could simplify this to just throw + type annotation.

@guizmaii guizmaii merged commit 54cfd7f into series/2.x Jul 31, 2025
15 of 16 checks passed
@guizmaii guizmaii deleted the opt_ZStream_fromIterator_0 branch July 31, 2025 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants