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
Simple test never stop? #2027
Comments
Note that it is also reproducible with e.g. s_leq_one = st.sampled_from((0, 1))
s_leq_two = st.sampled_from((0, 1, 2))
@given(x=s_leq_one, y=s_leq_two)
def test(x, y):
... |
We have an internal Separately, this isn't so terribly slow if you only pass the |
Although #1864 is fixed, my example still does not finish. I think this is a separate bug. pytest, hypothesis config:
Slightly simplified example without redundant
Also the example from hoefling still fails on 4.26.2 |
This also hangs on 622497c (4.26.2): @given(
x=st.integers(0, 1),
y=st.integers(0, 2),
)
def test_x_y(x, y):
assert True |
Similar to #1864, the “hang” occurs in |
This isn't solved by #2030, because |
On investigation, you're right (though it's not millions - that was true of the earlier version of this but the fact that we separate out finding the require prefix cuts out most of those), but it is hundreds. That's weird though - it shouldn't be possible for it to go that high because we only do rejection sampling on the first free block, which should almost never be that saturated. Will investigate what's going on. |
Ah, I see what's going on now. I've made a wrong assumption there that the rejection sampling only fails at the first block. Effectively the problem in this test is that we end up with long forced sequences in the middle of the byte stream after the first free byte. |
The following example seems to never pass, using hypothesis-4.24.6 running with pytest-5.0.0.
Going back to hypothesis 4.9.0, same pytest, the test passes almost instantly.
This looks like a regression but unsure.
See also a stack overflow q I asked https://stackoverflow.com/questions/56831605/why-does-my-simple-finite-hypothesis-test-never-stop
The text was updated successfully, but these errors were encountered: