mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-25 13:36:50 +00:00
test(rpc): align snapshot lease missing-disk expectation (#6108)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -2943,7 +2943,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn snapshot_lease_acquire_and_renew_handlers_fail_closed() {
|
async fn snapshot_lease_acquire_and_renew_handlers_fail_closed_for_missing_disk() {
|
||||||
let service = make_server();
|
let service = make_server();
|
||||||
let disk = "http://node-a:9000/data/rustfs0".to_string();
|
let disk = "http://node-a:9000/data/rustfs0".to_string();
|
||||||
|
|
||||||
@@ -2960,7 +2960,7 @@ mod tests {
|
|||||||
let acquire = service
|
let acquire = service
|
||||||
.acquire_snapshot_lease(acquire)
|
.acquire_snapshot_lease(acquire)
|
||||||
.await
|
.await
|
||||||
.expect("disabled acquire should return a protocol response")
|
.expect("missing-disk acquire should return a protocol response")
|
||||||
.into_inner();
|
.into_inner();
|
||||||
|
|
||||||
let mut renew = Request::new(SnapshotLeaseRenewRequest {
|
let mut renew = Request::new(SnapshotLeaseRenewRequest {
|
||||||
@@ -2977,14 +2977,14 @@ mod tests {
|
|||||||
let renew = service
|
let renew = service
|
||||||
.renew_snapshot_lease(renew)
|
.renew_snapshot_lease(renew)
|
||||||
.await
|
.await
|
||||||
.expect("disabled renew should return a protocol response")
|
.expect("missing-disk renew should return a protocol response")
|
||||||
.into_inner();
|
.into_inner();
|
||||||
|
|
||||||
for response in [acquire, renew] {
|
for response in [acquire, renew] {
|
||||||
assert!(!response.success);
|
assert!(!response.success);
|
||||||
assert!(response.token.is_empty());
|
assert!(response.token.is_empty());
|
||||||
assert_eq!(response.protocol_version, 1);
|
assert_eq!(response.protocol_version, 1);
|
||||||
assert_eq!(response.error, Some(DiskError::UnsupportedDisk.into()));
|
assert_eq!(response.error, Some(DiskError::other("cannot find disk").into()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user