Skip to content
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 two tests in preparation for julia nightly #3033

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

benlorenz
Copy link
Member

To adapt for changes in julia nightly, found while trying the Oscar tests locally with custom builds for the CxxWrap based packages.

Older julia versions have the weird effect of resizing arrays even when append! fails:

julia> v = [1,2,3];

julia> append!(v,[1.2]);
ERROR: InexactError: Int64(1.2)
...

julia> v
4-element Vector{Int64}:
 1
 2
 3
 0

This was changed in JuliaLang/julia#51903.

And julia might not always consider objects in the same scope as unused, even if they do not appear to be used anymore, see JuliaLang/julia#51818. This seems to depend where the GC marking is happening in the generated code and this was changed recently.
To avoid this one can put the code with the data that needs to be collected in a separate function (this pattern is also used in the julia tests).

@benlorenz benlorenz marked this pull request as draft November 22, 2023 10:04
@benlorenz benlorenz marked this pull request as ready for review November 22, 2023 14:46
@benlorenz benlorenz merged commit 93d63c3 into master Dec 7, 2023
16 of 20 checks passed
@benlorenz benlorenz deleted the bl/jlnightly branch December 7, 2023 09:38
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.

None yet

2 participants