georust / proj

Rust bindings for the latest stable release of PROJ
https://docs.rs/proj
Apache License 2.0
137 stars 45 forks source link

some failing tests #99

Closed michaelkirk closed 2 years ago

michaelkirk commented 2 years ago

We're seeing some failures in CI for https://github.com/georust/proj/pull/98 e.g.

https://github.com/georust/proj/runs/5014199807?check_suite_focus=true

Test failure look unrelated?

Indeed! I'm looking into that.

The failures seem eerily similar to the ones I found in: https://github.com/georust/proj/pull/97#issuecomment-994200364

I opened this PR just as a way to gather more data, to see if I could find a pattern.

CI Run from this branch: https://github.com/georust/proj/runs/5013682778?check_suite_focus=true

Curiously in #97, all the rust-1.53 tests were passing and it was the rust-1.52 tests that were failing. I'm not opposed to raising the MSRV, but it doesn't seem like the failures are as simple as "broken on old rust".

michaelkirk commented 2 years ago

I reran with no changes and now see all the rust-1.53 tests as passing, but two from rust-1.54 are now failing... there doesn't seem to be any pattern to the failures that I can see.

CI output

tldr;

lnicola commented 2 years ago

I get this one in a doc test on master, but only in release builds:

running 11 tests
test src/lib.rs - (line 56) ... ok
test src/proj.rs - proj::Proj::convert (line 714) ... ok
test src/geo_types.rs - geo_types::geo_types::Coordinate<T> (line 1) ... ok
test src/proj.rs - proj::ProjBuilder::proj_known_crs (line 419) ... ok
test src/lib.rs - (line 31) ... ok
test src/geo_types.rs - geo_types::geo_types::Point<T> (line 28) ... ok
test src/proj.rs - proj::Proj::new_known_crs (line 502) ... ok
test src/lib.rs - (line 179) ... ok
test src/lib.rs - (line 142) ... FAILED
test src/proj.rs - proj::Proj::project_array (line 804) ... ok
test src/proj.rs - proj::Proj::convert_array (line 770) ... ok

failures:

---- src/lib.rs - (line 142) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'assert_relative_eq!(result.x(), 158458.67, epsilon = 1e-2)

    left  = -14339492.078978319
    right = 158458.67
lnicola commented 2 years ago

It's strange. The test still fails (with a NaN) as a non-doc test. If I remove the proj_errno_reset, it starts to pass, but test_error_recovery now fails, which I guess invalidates my hopes about functions resetting errno on success.

lnicola commented 2 years ago

Looks like CI passed now :tada:.

michaelkirk commented 2 years ago

Fixed in #104