polars icon indicating copy to clipboard operation
polars copied to clipboard

CI: Rust tests fail on macOS

Open cnpryer opened this issue 3 years ago • 4 comments

nightly-2022-04-01 macOS Monterey 12.1

failures:

---- tests::io::test_parquet_statistics stdout ----
thread 'tests::io::test_parquet_statistics' panicked at 'assertion failed: std::env::var(\"POLARS_PANIC_IF_PARQUET_PARSED\").is_err()', /Users/chrispryer/github/polars/polars/polars-io/src/parquet/read_impl.rs:81:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::io::test_parquet_statistics_no_skip stdout ----
thread 'tests::io::test_parquet_statistics_no_skip' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:37:37

---- tests::io::test_row_count stdout ----
thread 'tests::io::test_row_count' panicked at 'assertion failed: std::env::var(\"POLARS_PANIC_IF_PARQUET_PARSED\").is_err()', /Users/chrispryer/github/polars/polars/polars-io/src/parquet/read_impl.rs:81:13

---- tests::io::test_simple_slice stdout ----
thread 'tests::io::test_simple_slice' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:244:37

---- tests::io::test_slice_filter stdout ----
thread 'tests::io::test_slice_filter' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:278:37

---- tests::io::test_union_and_agg_projections stdout ----
thread 'tests::io::test_union_and_agg_projections' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:253:37

---- tests::optimization_checks::test_simple_slice stdout ----
thread 'tests::optimization_checks::test_simple_slice' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/optimization_checks.rs:145:37


failures:
    tests::io::test_parquet_statistics
    tests::io::test_parquet_statistics_no_skip
    tests::io::test_row_count
    tests::io::test_simple_slice
    tests::io::test_slice_filter
    tests::io::test_union_and_agg_projections
    tests::optimization_checks::test_simple_slice

test result: FAILED. 137 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.15s

Spent some time debugging this trying to build some context while working on #2783. I noticed a good amount was due to POLARS_PANIC_IF_PARQUET_PARSED usage for testing.

Maybe im running into

Note that while concurrent access to environment variables is safe in Rust, some platforms only expose inherently unsafe non-threadsafe APIs for inspecting the environment.

(https://doc.rust-lang.org/std/env/fn.set_var.html)

I'm new to mac, so I just want to give that disclaimer.

cnpryer avatar Apr 11 '22 22:04 cnpryer

Confirming these test failures on both MacOS Monterey 12.3.1 on Apple Silicon (M1 Max) with rust nightly 2022-04-03, and on MacOS Big Sur 11.6.4 on Intel x86_64 with rust nightly 2022-04-06.

Typical panic in these failures are in the line like this one polars/polars-lazy/src/tests/io.rs:244

    let _guard = SINGLE_LOCK.lock().unwrap();

where SINGLE_LOCK is defined within lazy_static! macro.

lazy_static! {
    // needed prevent race conditions during test execution
    // for example with env vars set for tests
    // or global string cache resets.
    pub(crate) static ref SINGLE_LOCK: Mutex<()> = Mutex::new(());
}

I have not debugged the issue and do not claim that lazy_static is at fault, but am curious whether using once_cell crate would be better here. once_cell is on the path to be merged into rust std lib and it supersedes functionality of lazy_static.

slonik-az avatar Apr 12 '22 00:04 slonik-az

I'm also encountering this issue.

andrei-ionescu avatar Jul 07 '22 11:07 andrei-ionescu

Wanted to check in here again since I'm tinkering on the rust side and can update this issue with a more recent nightly run.

fwiw im on macOS Monterey 12.5 using nightly-2022-07-24 and I still have failing tests master.

failures:

---- tests::io::test_parquet_statistics stdout ----
thread 'tests::io::test_parquet_statistics' panicked at 'assertion failed: std::env::var(\"POLARS_PANIC_IF_PARQUET_PARSED\").is_err()', polars/polars-io/src/parquet/read_impl.rs:104:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::io::test_parquet_statistics_no_skip stdout ----
thread 'tests::io::test_parquet_statistics_no_skip' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:38:37

---- tests::io::test_row_count_on_files stdout ----
thread 'tests::io::test_row_count_on_files' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:338:37

---- tests::io::test_simple_slice stdout ----
thread 'tests::io::test_simple_slice' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:245:37

---- tests::io::test_slice_filter stdout ----
thread 'tests::io::test_slice_filter' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:279:37

---- tests::io::test_union_and_agg_projections stdout ----
thread 'tests::io::test_union_and_agg_projections' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/io.rs:254:37

---- tests::optimization_checks::test_simple_slice stdout ----
thread 'tests::optimization_checks::test_simple_slice' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/optimization_checks.rs:147:37

---- tests::optimization_checks::test_slice_pushdown_groupby stdout ----
thread 'tests::optimization_checks::test_slice_pushdown_groupby' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/optimization_checks.rs:194:37

---- tests::optimization_checks::test_slice_pushdown_join stdout ----
thread 'tests::optimization_checks::test_slice_pushdown_join' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/optimization_checks.rs:166:37

---- tests::optimization_checks::test_slice_pushdown_sort stdout ----
thread 'tests::optimization_checks::test_slice_pushdown_sort' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', polars/polars-lazy/src/tests/optimization_checks.rs:223:37


failures:
    tests::io::test_parquet_statistics
    tests::io::test_parquet_statistics_no_skip
    tests::io::test_row_count_on_files
    tests::io::test_simple_slice
    tests::io::test_slice_filter
    tests::io::test_union_and_agg_projections
    tests::optimization_checks::test_simple_slice
    tests::optimization_checks::test_slice_pushdown_groupby
    tests::optimization_checks::test_slice_pushdown_join
    tests::optimization_checks::test_slice_pushdown_sort

test result: FAILED. 145 passed; 10 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.14s

Full: https://pastebin.com/CR7C5xAK

cnpryer avatar Aug 14 '22 21:08 cnpryer

@cnpryer what is the command you are running?

matteosantama avatar Aug 20 '22 18:08 matteosantama

I will close this as this is a setup problem.

ritchie46 avatar Oct 21 '22 18:10 ritchie46

In case I return to this.

I will close this as this is a setup problem.

What about my setup would need to change?

cnpryer avatar Oct 21 '22 18:10 cnpryer