mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 16:16:55 +00:00
build: upgrade Rust baseline to 1.96.0 (#3291)
* build: upgrade Rust baseline to 1.96.0 * ci: pin Rust workflows to 1.96.0 * remove * ci: pin setup action to Rust 1.96.0 * build: pin toolchain to Rust 1.96.0
This commit is contained in:
@@ -20,5 +20,5 @@ Example:
|
||||
```powershell
|
||||
$env:RUSTFS_MINIO_FIXTURE_ROOT = '.\rustfs\tmp\minio-fixture-lab-local-key'
|
||||
$env:RUSTFS_MINIO_STATIC_KMS_KEY_B64 = '<base64-32-byte-local-minio-kms-key>'
|
||||
cargo +1.95.0 test -p rustfs-ecstore --features rio-v2 --test minio_generated_read_test -- --ignored
|
||||
cargo +1.96.0 test -p rustfs-ecstore --features rio-v2 --test minio_generated_read_test -- --ignored
|
||||
```
|
||||
|
||||
@@ -800,6 +800,7 @@ mod tests {
|
||||
should_warn_lock_failure,
|
||||
};
|
||||
use crate::{LockError, LockId, LockInfo, LockRequest, LockResponse, LockStats, LockType, ObjectKey, client::LockClient};
|
||||
use std::assert_matches;
|
||||
use std::{
|
||||
collections::{HashMap, VecDeque},
|
||||
sync::{Arc, Mutex},
|
||||
@@ -1105,7 +1106,7 @@ mod tests {
|
||||
let result = lock.acquire_guard(&request).await;
|
||||
let elapsed = started.elapsed();
|
||||
|
||||
assert!(matches!(result, Ok(None)), "unexpected result: {result:?}");
|
||||
assert_matches!(result, Ok(None));
|
||||
assert!(
|
||||
elapsed >= Duration::from_millis(250),
|
||||
"remote RPC timeouts should be retried within the caller timeout, got {elapsed:?}"
|
||||
@@ -1131,7 +1132,7 @@ mod tests {
|
||||
let started = tokio::time::Instant::now();
|
||||
let result = lock.acquire_guard(&request).await;
|
||||
|
||||
assert!(matches!(result, Ok(None)), "unexpected result: {result:?}");
|
||||
assert_matches!(result, Ok(None));
|
||||
assert!(
|
||||
started.elapsed() < Duration::from_secs(1),
|
||||
"acquire should fail this attempt before waiting for delayed impossible-quorum tasks"
|
||||
@@ -1210,7 +1211,7 @@ mod tests {
|
||||
|
||||
let result = lock.acquire_lock_quorum_with_retry(&request).await.unwrap();
|
||||
|
||||
assert!(matches!(result.failure_kind, Some(LockAcquireFailureKind::NonRetryable)));
|
||||
assert_matches!(result.failure_kind, Some(LockAcquireFailureKind::NonRetryable));
|
||||
assert!(
|
||||
result
|
||||
.response
|
||||
@@ -1254,7 +1255,7 @@ mod tests {
|
||||
let result = lock.acquire_guard(&request).await;
|
||||
let elapsed = started.elapsed();
|
||||
|
||||
assert!(matches!(result, Ok(None)), "unexpected result: {result:?}");
|
||||
assert_matches!(result, Ok(None));
|
||||
assert!(
|
||||
elapsed >= Duration::from_millis(250),
|
||||
"expected at least one retry attempt for transient timeout, got {elapsed:?}"
|
||||
@@ -1273,7 +1274,7 @@ mod tests {
|
||||
|
||||
let result = lock.acquire_guard(&request).await;
|
||||
|
||||
assert!(matches!(result, Ok(None)), "unexpected result: {result:?}");
|
||||
assert_matches!(result, Ok(None));
|
||||
let seen_timeouts = seen_timeouts.lock().unwrap();
|
||||
assert!(!seen_timeouts.is_empty(), "expected lock clients to observe acquire timeouts");
|
||||
assert!(
|
||||
@@ -1297,7 +1298,7 @@ mod tests {
|
||||
|
||||
let result = tokio::time::timeout(Duration::from_millis(800), lock.acquire_guard(&request)).await;
|
||||
|
||||
assert!(matches!(result, Ok(Ok(None))), "unexpected result: {result:?}");
|
||||
assert_matches!(result, Ok(Ok(None)));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
@@ -290,17 +290,18 @@ impl From<tonic::Status> for LockError {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::assert_matches;
|
||||
|
||||
#[test]
|
||||
fn test_error_creation() {
|
||||
let timeout_err = LockError::timeout("test-resource", Duration::from_secs(5));
|
||||
assert!(matches!(timeout_err, LockError::Timeout { .. }));
|
||||
assert_matches!(timeout_err, LockError::Timeout { .. });
|
||||
|
||||
let not_found_err = LockError::resource_not_found("missing-resource");
|
||||
assert!(matches!(not_found_err, LockError::ResourceNotFound { .. }));
|
||||
assert_matches!(not_found_err, LockError::ResourceNotFound { .. });
|
||||
|
||||
let permission_err = LockError::permission_denied("insufficient privileges");
|
||||
assert!(matches!(permission_err, LockError::PermissionDenied { .. }));
|
||||
assert_matches!(permission_err, LockError::PermissionDenied { .. });
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -30,7 +30,7 @@ Or point the tests at another generated root:
|
||||
|
||||
```powershell
|
||||
$env:RUSTFS_MINIO_FIXTURE_ROOT = '.\rustfs\tmp\minio-fixture-lab-smoke'
|
||||
cargo +1.95.0 test -p rustfs-rio-v2 --test minio_generated_fixtures -- --ignored
|
||||
cargo +1.96.0 test -p rustfs-rio-v2 --test minio_generated_fixtures -- --ignored
|
||||
```
|
||||
|
||||
## Scope
|
||||
|
||||
Reference in New Issue
Block a user