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
Internal error: tests using unique collections containing nan
are flaky
#3926
Comments
I haven't tried to bisect this yet, but it's possible this regressed in
|
# while generating 'Draw 1: ' from
types_strat = sampled_from([type(None), bool, int, float, str, bytes])
dictionaries(
keys=shared(types_strat, key='typevar=~KT').flatmap(from_type).filter(_can_hash),
values=shared(types_strat, key='typevar=~VT').flatmap(from_type)
).map(ChainMap) It might also be relevant that all of the examples I remember have involved sets or mappings; I'd suspect iteration order but |
Manually shrunk to the following: dictionaries(
keys=st.floats(),
values=st.just(None),
) Anecdotally using def f():
s = dictionaries(
keys=st.floats(),
values=st.just(None),
)
s.example()
for i in range(1000):
print("-" * 25, i, "-" * 25)
f() |
reduced further: lists(
st.floats(allow_infinity=False),
min_size=0,
max_size=3,
unique=True,
) something to do with multiple n = 18444492273895866368
assert math.isnan(int_to_float(n))
assert int_to_float(n) not in [int_to_float(n)] is relevant? ( |
Yep, that would do it! List containment (and maybe other collections?) uses Probably the correct general solution is to ensure that we return a different float object each time we generate a This trades away a little bit of test power which we had ~by accident; we may well want to bring that back in future but should do so above the IR layer. |
test_generic_collections_only_use_hashable_elements[FrozenSet]
is flakynan
are flaky
e.g. https://github.com/HypothesisWorks/hypothesis/actions/runs/8313487434/job/22749533612?pr=3924#step:6:581
I've also hit a weird pytest crash a couple of times, but it looks like psf/black#4224 just hasn't been released yet.
The text was updated successfully, but these errors were encountered: