Skip to content

Commit 12dd49b

Browse files
authored
RUST-2342 Skip flaky timing-based tests on macos (#1694)
1 parent bdddefc commit 12dd49b

7 files changed

Lines changed: 49 additions & 9 deletions

File tree

driver/src/sdam/test.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ use crate::{
3030

3131
#[tokio::test(flavor = "multi_thread")]
3232
async fn min_heartbeat_frequency() {
33+
if cfg!(target_os = "macos") {
34+
log_uncaptured("skipping min_heartbeat_frequency: flaky on macos");
35+
return;
36+
}
3337
if topology_is_load_balanced().await {
3438
log_uncaptured("skipping min_heartbeat_frequency test due to load-balanced topology");
3539
return;
@@ -87,6 +91,10 @@ async fn min_heartbeat_frequency() {
8791

8892
#[tokio::test(flavor = "multi_thread")]
8993
async fn sdam_pool_management() {
94+
if cfg!(target_os = "macos") {
95+
log_uncaptured("skipping sdam_pool_management: flaky on macos");
96+
return;
97+
}
9098
if !server_version_matches(">= 4.2.9").await {
9199
log_uncaptured(
92100
"skipping sdam_pool_management test due to server not supporting appName failCommand",

driver/src/test/change_stream.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ async fn init_stream(
6767
/// Prose test 1: ChangeStream must continuously track the last seen resumeToken
6868
#[tokio::test]
6969
async fn tracks_resume_token() -> Result<()> {
70+
if cfg!(target_os = "macos") {
71+
log_uncaptured("skipping tracks_resume_token: flaky on macos");
72+
return Ok(());
73+
}
7074
let (client, coll, mut stream) = match init_stream("track_resume_token", false).await? {
7175
Some(t) => t,
7276
None => return Ok(()),

driver/src/test/client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,10 @@ async fn backpressure_run_unified() {
10841084
// backpressure prose test #1
10851085
#[tokio::test(flavor = "multi_thread")]
10861086
async fn operation_retry_uses_exponential_backoff() {
1087+
if cfg!(target_os = "macos") {
1088+
log_uncaptured("skipping operation_retry_uses_exponential_backoff: flaky on macos");
1089+
return;
1090+
}
10871091
if server_version_lt(4, 4).await {
10881092
log_uncaptured("skipping operation_retry_uses_exponential_backoff: requires 4.4+");
10891093
return;

driver/src/test/cursor.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ use crate::{
77
bson::doc,
88
options::{CreateCollectionOptions, CursorType, FindOptions},
99
runtime,
10+
test::log_uncaptured,
1011
Client,
1112
};
1213

1314
#[tokio::test]
1415
#[function_name::named]
1516
async fn tailable_cursor() {
17+
if cfg!(target_os = "macos") {
18+
log_uncaptured("skipping tailable_cursor: flaky on macos");
19+
return;
20+
}
1621
let client = Client::for_test().await;
1722
let coll = client
1823
.create_fresh_collection(

driver/src/test/spec/retryable_reads.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ async fn run_unified() {
4141
/// pool before the second attempt.
4242
#[tokio::test(flavor = "multi_thread")]
4343
async fn retry_releases_connection() {
44+
if cfg!(target_os = "macos") {
45+
log_uncaptured("skipping retry_releases_connection: flaky on macos");
46+
return;
47+
}
48+
4449
let mut client_options = get_client_options().await.clone();
4550
client_options.hosts.drain(1..);
4651
client_options.retry_reads = Some(true);

driver/src/test/spec/sdam.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,33 @@ async fn run_unified() {
3737
]);
3838
}
3939

40+
let mut skipped_tests = vec![
41+
// The driver does not support socketTimeoutMS.
42+
"Reset server and pool after network timeout error during authentication",
43+
"Ignore network timeout error on find",
44+
"apply backpressure on network timeout error during connection establishment",
45+
// TODO RUST-2068: unskip these tests
46+
"Pool is cleared on handshake error during minPoolSize population",
47+
"Pool is cleared on authentication error during minPoolSize population",
48+
];
49+
if cfg!(target_os = "macos") {
50+
skipped_tests
51+
.extend_from_slice(&["Topology lifecycle", "Command error on Monitor handshake"]);
52+
}
53+
4054
run_unified_tests(&["server-discovery-and-monitoring", "unified"])
4155
.skip_files(&skipped_files)
42-
.skip_tests(&[
43-
// The driver does not support socketTimeoutMS.
44-
"Reset server and pool after network timeout error during authentication",
45-
"Ignore network timeout error on find",
46-
"apply backpressure on network timeout error during connection establishment",
47-
// TODO RUST-2068: unskip these tests
48-
"Pool is cleared on handshake error during minPoolSize population",
49-
"Pool is cleared on authentication error during minPoolSize population",
50-
])
56+
.skip_tests(&skipped_tests)
5157
.await;
5258
}
5359

5460
/// Streaming protocol prose test 1 from SDAM spec tests.
5561
#[tokio::test(flavor = "multi_thread")]
5662
async fn streaming_min_heartbeat_frequency() {
63+
if cfg!(target_os = "macos") {
64+
log_uncaptured("skipping streaming_min_heartbeat_frequency: flaky on macos");
65+
return;
66+
}
5767
if topology_is_load_balanced().await {
5868
log_uncaptured("skipping streaming_min_heartbeat_frequency due to load balanced topology");
5969
return;

driver/src/test/spec/transactions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ async fn write_concern_not_inherited() {
280280

281281
#[tokio::test(flavor = "multi_thread")]
282282
async fn convenient_api_retry_backoff_is_enforced() {
283+
if cfg!(target_os = "macos") {
284+
log_uncaptured("skipping convenient_api_retry_backoff_is_enforced: flaky on macos");
285+
return;
286+
}
283287
if !transactions_supported().await {
284288
log_uncaptured("skipping convenient_retry_backoff_is_enforced: transactions not supported");
285289
return;

0 commit comments

Comments
 (0)