fix two tests in preparation for julia nightly #3033
Merged
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.
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: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).