Skip to content

Commit

Permalink
Rollup merge of rust-lang#133435 - RalfJung:test_downgrade_observe, r…
Browse files Browse the repository at this point in the history
…=tgross35

miri: disable test_downgrade_observe test on macOS

Due to rust-lang#121950, this test can fail on Miri. The test is also quite slow on Miri (taking more than 30s) due to the high iteration count (a total of 2000), so let's reduce that a little.

Fixes rust-lang#133421
  • Loading branch information
compiler-errors authored Nov 26, 2024
2 parents f5c1f7f + c9b56b9 commit c4e2b0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/std/src/sync/rwlock/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,15 @@ fn test_downgrade_basic() {
}

#[test]
// FIXME: On macOS we use a provenance-incorrect implementation and Miri catches that issue.
// See <https://github.com/rust-lang/rust/issues/121950> for details.
#[cfg_attr(all(miri, target_os = "macos"), ignore)]
fn test_downgrade_observe() {
// Taken from the test `test_rwlock_downgrade` from:
// https://github.com/Amanieu/parking_lot/blob/master/src/rwlock.rs

const W: usize = 20;
const N: usize = 100;
const N: usize = if cfg!(miri) { 40 } else { 100 };

// This test spawns `W` writer threads, where each will increment a counter `N` times, ensuring
// that the value they wrote has not changed after downgrading.
Expand Down

0 comments on commit c4e2b0c

Please sign in to comment.