-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Intermittent test failure for intervals_match_pg_values_f64
testcase
#3429
Comments
That's one of the "fuzzing" tests. For reference:
These are hard to debug. It would be helpful to investigate which of test calls causes the problem. After that we should be able to reproduce this by using the printed value + the test code behind the macro. Can you try to get these informations |
I'll see what I can do! |
@weiznich apologies for the delay |
@czotomo Thanks for providing these values. I will try to have a look at that. |
let val = -705.0759657500337; // or std::mem::transmute(13872785166456217622u64)
test_years(val); // this would fail
let value = val.years(); // PgInterval { microseconds: 0, days: 0, months: -8460 }
let sql_str = format!("'{} years'::interval", val); // PgInterval { microseconds: 0, days: 0, months: -8461 } And I've tried
According to docs for postgres 16, the fraction part should be rounded instead of
I've tried patch it with diesel/diesel/src/pg/expression/extensions/interval_dsl.rs Lines 239 to 241 in a5c82df
fn years(self) -> PgInterval {
((self * 12.0).round() as i32).months()
} |
Setup
Versions
Problem Description
Every now and then, while running tests, I will get a panic in this function
What are you trying to accomplish?
Run tests -
bin/test
Checklist
closed if this is not the case)
I can get this test to pass by rerunning the test script (sometimes it takes few tries to get it to work).
I have zero idea what might be the case.
FWIW this also shows up on a Macbook Pro @ Ventura MacOS with same Rust + Diesel version combo.
The text was updated successfully, but these errors were encountered: