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

Test failures since switch to rand 0.8 #258

Closed
plugwash opened this issue Jan 23, 2022 · 5 comments · Fixed by #261
Closed

Test failures since switch to rand 0.8 #258

plugwash opened this issue Jan 23, 2022 · 5 comments · Fixed by #261

Comments

@plugwash
Copy link

plugwash commented Jan 23, 2022

I am investigating upgrading the rust packaging in Debian to rand 0.8 and I have noticed that proptest seems to suffer from test failures since it switched to rand 0.8.

cargo test -p proptest --lib

failures:

---- num::test::contract_sanity::f32::range_from stdout ----
thread 'num::test::contract_sanity::f32::range_from' panicked at 'Uniform::new_inclusive: range overflow', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.4/src/distributions/uniform.rs:996:1
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

---- num::test::contract_sanity::f32::range_to_inclusive stdout ----
thread 'num::test::contract_sanity::f32::range_to_inclusive' panicked at 'Uniform::new_inclusive: range overflow', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.4/src/distributions/uniform.rs:996:1

---- num::test::contract_sanity::f64::range_from stdout ----
thread 'num::test::contract_sanity::f64::range_from' panicked at 'Uniform::new_inclusive: range overflow', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.4/src/distributions/uniform.rs:997:1

---- num::test::contract_sanity::f64::range_to_inclusive stdout ----
thread 'num::test::contract_sanity::f64::range_to_inclusive' panicked at 'Uniform::new_inclusive: range overflow', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.4/src/distributions/uniform.rs:997:1

failures:
num::test::contract_sanity::f32::range_from
num::test::contract_sanity::f32::range_to_inclusive
num::test::contract_sanity::f64::range_from
num::test::contract_sanity::f64::range_to_inclusive

test result: FAILED. 1421 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 783.81s

error: test failed, to rerun pass '-p proptest --lib'

I can reproduce the failures with commit commit bc2d867 (current HEAD) and commit 291908a (the first commit to use rand 0.8) and but not with 37dba3a (the last commit to use rand 0.7)

Ideally I'd like to see a fix for this issue, but if that is not possible, i'd at least like an opinion on how serious these failures are so I can decide whether they should block Debian's transition to rand 0.8.

@ghost
Copy link

ghost commented Jan 26, 2022

It's 0.8.4 in particular. The reason seems to be this change: rust-random/rand#1108 .

@plugwash
Copy link
Author

Hmm, yes thanks for the link, so it seems that the rand guys didn't consider a change from dodgy results to a panic to be a semver-breaking change.

That still leaves the question of how to address this? is this likely to break actual users of proptest? is there a way to disable/modify the tests only for floating point types?

@plugwash
Copy link
Author

plugwash commented Feb 5, 2022

For what it's worth, after testing reverse dependencies I decided that these failures were not significant enough to block the rand transition in Debian and disabled the tests in question.

@russelldb
Copy link

This is very blocking for me. I get the error all the time. Does #261 fix?

@russelldb
Copy link

Looking at the history of Ran, Uniform::new panicked even in version 0.6…I don't understand how this can be attributed to the rand crate

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 a pull request may close this issue.

2 participants