about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-26 12:03:45 -0500
committerGitHub <noreply@github.com>2024-11-26 12:03:45 -0500
commitc4e2b0c60514736dbacc65908217197cf15d6b83 (patch)
treecbc38eb48291c9ae02cfce640b0d5cf49078bcb9
parentf5c1f7fae153be09cac4e7153910a46f6492b122 (diff)
parentc9b56b9694c57dcf41a148e73384702f103b137f (diff)
downloadrust-c4e2b0c60514736dbacc65908217197cf15d6b83.tar.gz
rust-c4e2b0c60514736dbacc65908217197cf15d6b83.zip
Rollup merge of #133435 - RalfJung:test_downgrade_observe, r=tgross35
miri: disable test_downgrade_observe test on macOS

Due to https://github.com/rust-lang/rust/issues/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 https://github.com/rust-lang/rust/issues/133421
-rw-r--r--library/std/src/sync/rwlock/tests.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/rwlock/tests.rs
index 29cad4400f1..48d442921f7 100644
--- a/library/std/src/sync/rwlock/tests.rs
+++ b/library/std/src/sync/rwlock/tests.rs
@@ -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.