-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Sets test failure: !(isequal(s.dict.keys,k)) #11890
Comments
The failing test seems to be the newly added |
And from the comment, this behavior is GC sensitive which can probably explain that it doesn't happen everytime. |
Ref #11795 |
Actually that line just cause a retry so it should not be a problem? |
The issue seems to be that the rehash doesn't really have to do anything (it basically just create another hash table) However, since it doesn't initialize the not used elements in the key table (and it doesn't need to do that), the key array can be equal or not depending on whatever was in the array initiailly. Best shown like this. julia> function t()
s = Set(1:5)
k = s.dict.keys
Base.rehash!(s)
s.dict.keys, k
end
t (generic function with 1 method)
julia> t()
([0,4,0,0,0,2,3,0,140728686160976,0,0,0,5,0,0,1],[0,4,0,0,0,2,3,0,140728687306304,0,0,0,5,0,0,1])
julia> t()
([140728687306016,4,0,140728687305952,0,2,3,0,0,0,0,0,5,140728687306080,0,1],[140728687304960,4,0,140728687305120,0,2,3,0,0,0,140728687304416,140728687304448,5,140728687305296,0,1]) |
IMHO, the best way to test this might be sth like this. julia> function t()
s = Set(["a", "b", "c"])
Base.rehash!(s)
k = s.dict.keys
Base.rehash!(s)
s.dict.keys, k
end
t (generic function with 1 method)
julia> t()
(ASCIIString[#undef,#undef,#undef,"c",#undef,#undef,#undef,#undef,"b",#undef,#undef,#undef,#undef,"a",#undef,#undef],ASCIIString[#undef,#undef,#undef,"c",#undef,#undef,#undef,#undef,"b",#undef,#undef,#undef,#undef,"a",#undef,#undef])
julia> t()
(ASCIIString[#undef,#undef,#undef,"c",#undef,#undef,#undef,#undef,"b",#undef,#undef,#undef,#undef,"a",#undef,#undef],ASCIIString[#undef,#undef,#undef,"c",#undef,#undef,#undef,#undef,"b",#undef,#undef,#undef,#undef,"a",#undef,#undef]) P.S. how do we compare two arrays with embeded |
Implemented #11892 |
Seen this in a few PR's, and now a master build: https://travis-ci.org/JuliaLang/julia/jobs/68599318 (osx)
Can anyone reproduce locally?
The text was updated successfully, but these errors were encountered: