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 huge allocation for OffsetDateTime Arb without arguments #3491
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LocalDateTime.MIN and MAX cause a 2bn, 8GB array to be allocated on each call. Resulting in OutOfMemoryExceptions on most systems.
sksamuel
approved these changes
Apr 19, 2023
nomisRev
pushed a commit
to arrow-kt/arrow-website
that referenced
this pull request
May 11, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.kotest:kotest-runner-junit5](https://togithub.com/kotest/kotest) | `5.6.1` -> `5.6.2` | [![age](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-runner-junit5/5.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-runner-junit5/5.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-runner-junit5/5.6.2/compatibility-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-runner-junit5/5.6.2/confidence-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | | [io.kotest:kotest-property](https://togithub.com/kotest/kotest) | `5.6.1` -> `5.6.2` | [![age](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-property/5.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-property/5.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-property/5.6.2/compatibility-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-property/5.6.2/confidence-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | | [io.kotest:kotest-framework-engine](https://togithub.com/kotest/kotest) | `5.6.1` -> `5.6.2` | [![age](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-framework-engine/5.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-framework-engine/5.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-framework-engine/5.6.2/compatibility-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-framework-engine/5.6.2/confidence-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | | [io.kotest:kotest-assertions-core](https://togithub.com/kotest/kotest) | `5.6.1` -> `5.6.2` | [![age](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-assertions-core/5.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-assertions-core/5.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-assertions-core/5.6.2/compatibility-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.kotest:kotest-assertions-core/5.6.2/confidence-slim/5.6.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>kotest/kotest</summary> ### [`v5.6.2`](https://togithub.com/kotest/kotest/releases/tag/v5.6.2) ##### 5.6.2 May 2023 ##### Assertions - Adding shouldHaveSameInstantAs matcher for OffsetDateTime. Fixes [#​3488](https://togithub.com/kotest/kotest/issues/3488) by [@​Kantis](https://togithub.com/Kantis) in [kotest/kotest#3501 ##### Property testing - Fixes a problem with property testing on Apple platforms [#​3506](https://togithub.com/kotest/kotest/issues/3506) - Reverts behaviour of `Arb.string()` to only generate Strings of printable ascii characters - 5.6.0 changed it to include some control characters, see [#​3513](https://togithub.com/kotest/kotest/issues/3513) for details - Fix huge allocation for OffsetDateTime Arb without arguments by [@​rescribet](https://togithub.com/rescribet) in [kotest/kotest#3491 - Fix Arb.map edgecases by [@​myuwono](https://togithub.com/myuwono) in [kotest/kotest#3496 ##### Documentation - Update writing_tests.md by [@​erikhuizinga](https://togithub.com/erikhuizinga) in [kotest/kotest#3497 - Update shouldBeEqualToComparingFields doc by [@​ktrueda](https://togithub.com/ktrueda) in [kotest/kotest#3416 ##### Other - Build Kotlin/Native library for ARM64 on Linux by [@​charleskorn](https://togithub.com/charleskorn) in [kotest/kotest#3521 #####⚠️ Reverted behavior of `Arb.string()` With Kotest 5.6.0, `Codepoint.ascii()` was changed to include a wider range of ascii chararacters, and `Codepoint.printableAscii()` was introduced with the historic range used by `Codepoint.ascii()`. `Arb.string()` has been using `Codepoint.ascii()` as it's default for generating chars for the string. This caused issues for some users, and we decided to revert `Arb.string()` to the historic behavior by changing the default to the new `Codepoint.printableAscii()`. Hopefully this doesn't cause any issues for you. If it does, you can revert to the 5.6.0 ~ 5.6.1 behavior by using `Codepoint.ascii()` explicitly. If you added explicit usage of `Codepoint.printableAscii()` to circumvent the issue, you can safely remove the explicit parameter starting with Kotest 5.6.2. ##### New Contributors - [@​rescribet](https://togithub.com/rescribet) made their first contribution in [kotest/kotest#3491 - [@​ktrueda](https://togithub.com/ktrueda) made their first contribution in [kotest/kotest#3416 - [@​erikhuizinga](https://togithub.com/erikhuizinga) made their first contribution in [kotest/kotest#3497 **Full Changelog**: kotest/kotest@v5.6.1...v5.6.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/arrow-kt/arrow-website). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS43NS4wIiwidXBkYXRlZEluVmVyIjoiMzUuNzUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using
LocalDateTime.MIN
andMAX
cause a 2 billion, 8GB Int array to be allocated on each call. Resulting in OutOfMemoryExceptions on most systems.Issue can be reproduced by changing the defaults back to the previous values and running the newly added tests.
This commit lets
offsetDateTime
andzonedDateTime
use the same default as its sibling functionlocalDateTime
.