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 assumption that deep copied 0-field mutable structs compare equal #132

Merged
merged 1 commit into from
Sep 23, 2019

Conversation

KristofferC
Copy link
Contributor

When running the tests for this package on the upcoming 1.3 release I got the error:

solverstring = "Alpine.UnsetSolver()"
Partitioning variable selection tests :: nlp3: Error During Test at /root/.julia/packages/Alpine/yThaY/test/solver.jl:18
  Got exception outside of a @test
  Unsupported MINLP local solver Alpine.UnsetSolver(); use a Alpine-supported MINLP local solver

I tracked it down to the following issue JuliaLang/julia#33359.

This PR works around the problem.

@KristofferC KristofferC changed the title work around mutable structs not comparing equal on 1.3 work around singleton mutable structs not comparing equal on 1.3 Sep 22, 2019
@codecov
Copy link

codecov bot commented Sep 22, 2019

Codecov Report

Merging #132 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
+ Coverage   77.08%   77.09%   +<.01%     
==========================================
  Files          15       15              
  Lines        3155     3152       -3     
==========================================
- Hits         2432     2430       -2     
+ Misses        723      722       -1
Impacted Files Coverage Δ
src/solver.jl 97.83% <ø> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4078aaf...6412ae0. Read the comment docs.

@KristofferC
Copy link
Contributor Author

KristofferC commented Sep 22, 2019

On more careful examination, this is the result of a bugfix in deepcopy with mutable structs being considered non-singleton (JuliaLang/julia#31825).

The lines at:

Alpine.jl/src/solver.jl

Lines 485 to 487 in 4078aaf

deepcopy(nlp_solver),
deepcopy(minlp_solver),
deepcopy(mip_solver),

makes the check for == with empty_solver be false. I believe this is a correct bugfix for the problem shown by the test failure.

@KristofferC KristofferC changed the title work around singleton mutable structs not comparing equal on 1.3 fix assumption that deep copied 0-filed mutable structs compare equal Sep 22, 2019
@KristofferC KristofferC changed the title fix assumption that deep copied 0-filed mutable structs compare equal fix assumption that deep copied 0-field mutable structs compare equal Sep 22, 2019
@harshangrjn
Copy link
Collaborator

Thanks @KristofferC for catching this.

@harshangrjn harshangrjn merged commit 5637b75 into lanl-ansi:master Sep 23, 2019
@KristofferC KristofferC deleted the patch-1 branch September 23, 2019 19:15
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