Skip to content

Commit

Permalink
Use -Zmiri-tree-borrows for miri testing and reenable many tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Feb 19, 2024
1 parent 44b74b5 commit 94e4ab1
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ Tests which call foreign functions or access the filesystem are disabled.
The [inventory](https://crates.io/crates/inventory) crate does not work in miri, so there are workarounds in place for codecs, chunk key encodings, and chunk grids.
```bash
# FIXME: Why is `-Zmiri-ignore-leaks` needed?
MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-permissive-provenance -Zmiri-ignore-leaks" cargo +nightly miri test --all-features
MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-permissive-provenance -Zmiri-ignore-leaks -Zmiri-tree-borrows" cargo +nightly miri test --all-features
```
2 changes: 0 additions & 2 deletions src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,6 @@ mod tests {
}

#[test]
#[cfg_attr(miri, ignore)]
fn array_subset_round_trip() {
let store = Arc::new(MemoryStore::default());
let array_path = "/array";
Expand Down Expand Up @@ -888,7 +887,6 @@ mod tests {

// // Due to the nature of this test, it can fail sometimes. It was used for development but is now disabled.
// #[test]
// #[cfg_attr(miri, ignore)]
// fn array_subset_locking_disabled() {
// array_subset_locking(
// Arc::new(crate::storage::store_lock::DisabledStoreLocks::default()),
Expand Down
10 changes: 0 additions & 10 deletions src/array/codec/array_to_bytes/sharding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,7 @@ mod tests {
assert_eq!(bytes, decoded);
}

// FIXME: Investigate miri error for this test
#[test]
#[cfg_attr(miri, ignore)]
fn codec_sharding_round_trip1() {
for index_at_end in [true, false] {
for all_fill_value in [true, false] {
Expand All @@ -254,11 +252,9 @@ mod tests {
}
}

// FIXME: Investigate miri error for this test
#[cfg(feature = "gzip")]
#[cfg(feature = "crc32c")]
#[test]
#[cfg_attr(miri, ignore)]
fn codec_sharding_round_trip2() {
use crate::array::codec::{Crc32cCodec, GzipCodec};

Expand Down Expand Up @@ -328,10 +324,8 @@ mod tests {
assert_eq!(bytes, decoded);
}

// FIXME: Investigate miri error for this test
#[cfg(feature = "async")]
#[tokio::test]
#[cfg_attr(miri, ignore)]
async fn codec_sharding_async_round_trip() {
for index_at_end in [true, false] {
for all_fill_value in [true, false] {
Expand Down Expand Up @@ -414,7 +408,6 @@ mod tests {
}

#[test]
#[cfg_attr(miri, ignore)]
fn codec_sharding_partial_decode_all() {
for index_at_end in [true, false] {
for all_fill_value in [true, false] {
Expand Down Expand Up @@ -499,7 +492,6 @@ mod tests {

#[cfg(feature = "async")]
#[tokio::test]
#[cfg_attr(miri, ignore)]
async fn codec_sharding_async_partial_decode_all() {
for index_at_end in [true, false] {
for all_fill_value in [true, false] {
Expand All @@ -524,7 +516,6 @@ mod tests {
#[cfg(feature = "gzip")]
#[cfg(feature = "crc32c")]
#[test]
#[cfg_attr(miri, ignore)]
fn codec_sharding_partial_decode2() {
use crate::array::codec::ArrayCodecTraits;

Expand Down Expand Up @@ -571,7 +562,6 @@ mod tests {
}

#[test]
#[cfg_attr(miri, ignore)]
fn codec_sharding_partial_decode3() {
let chunk_shape: ChunkShape = vec![4, 4].try_into().unwrap();
let chunk_representation =
Expand Down
2 changes: 0 additions & 2 deletions src/array_subset/iterators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ mod tests {
}

#[test]
#[cfg_attr(miri, ignore)]
fn array_subset_par_iter_indices() {
use rayon::prelude::*;
let subset = ArraySubset::new_with_ranges(&[1..3, 1..3]);
Expand Down Expand Up @@ -181,7 +180,6 @@ mod tests {
}

#[test]
#[cfg_attr(miri, ignore)]
#[rustfmt::skip]
fn array_subset_par_iter_chunks() {
let subset = ArraySubset::new_with_ranges(&[2..5, 2..6]);
Expand Down
2 changes: 0 additions & 2 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ mod tests {

use super::*;

// This test non-deterministically? fails with miri in rayon (crossbeam-epoch)
#[test]
#[cfg_attr(miri, ignore)]
fn transformers_multithreaded() {
use rayon::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion tests/array_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ async fn array_async_read(array: Array<AsyncObjectStore<InMemory>>) -> Result<()

#[cfg(all(feature = "ndarray", feature = "async", feature = "object_store"))]
#[tokio::test]
#[cfg_attr(miri, ignore)]
#[cfg_attr(miri, ignore)] // FIXME: Check if this failure is real
async fn array_async_read_uncompressed() -> Result<(), Box<dyn std::error::Error>> {
let store = Arc::new(AsyncObjectStore::new(InMemory::new()));
let array_path = "/array";
Expand Down
1 change: 0 additions & 1 deletion tests/array_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ fn array_sync_read(array: Array<MemoryStore>) -> Result<(), Box<dyn std::error::

#[cfg(feature = "ndarray")]
#[test]
#[cfg_attr(miri, ignore)]
fn array_sync_read_uncompressed() -> Result<(), Box<dyn std::error::Error>> {
let store = Arc::new(MemoryStore::default());
let array_path = "/array";
Expand Down

0 comments on commit 94e4ab1

Please sign in to comment.