mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-22 12:26:37 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8df19b7b8b |
@@ -380,11 +380,25 @@ mod tests {
|
|||||||
cluster.start_node(1).await?;
|
cluster.start_node(1).await?;
|
||||||
|
|
||||||
let status_url = format!("{}/rustfs/admin/v3/background-heal/status", cluster.nodes[0].url);
|
let status_url = format!("{}/rustfs/admin/v3/background-heal/status", cluster.nodes[0].url);
|
||||||
|
let mut recovered = serde_json::Value::Null;
|
||||||
|
for _ in 0..60 {
|
||||||
let status_body = signed_admin_post(&status_url, None, &cluster.access_key, &cluster.secret_key).await?;
|
let status_body = signed_admin_post(&status_url, None, &cluster.access_key, &cluster.secret_key).await?;
|
||||||
assert!(
|
assert!(
|
||||||
!status_body.contains("MissingContentLength"),
|
!status_body.contains("MissingContentLength"),
|
||||||
"background heal status should not fail without an explicit Content-Length: {status_body}"
|
"background heal status should not fail without an explicit Content-Length: {status_body}"
|
||||||
);
|
);
|
||||||
|
recovered = serde_json::from_str(&status_body)
|
||||||
|
.map_err(|err| format!("background heal status is not JSON ({err}): {status_body}"))?;
|
||||||
|
if recovered["clusterStatusComplete"] == serde_json::Value::Bool(true) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sleep(Duration::from_secs(1)).await;
|
||||||
|
}
|
||||||
|
assert_eq!(
|
||||||
|
recovered["clusterStatusComplete"],
|
||||||
|
serde_json::Value::Bool(true),
|
||||||
|
"cluster heal status should recover before root heal starts: {recovered}"
|
||||||
|
);
|
||||||
|
|
||||||
let heal_body = r#"{"recursive":true,"dryRun":false,"remove":false,"recreate":true,"scanMode":2,"updateParity":false,"nolock":false}"#;
|
let heal_body = r#"{"recursive":true,"dryRun":false,"remove":false,"recreate":true,"scanMode":2,"updateParity":false,"nolock":false}"#;
|
||||||
let heal_url = format!("{}/rustfs/admin/v3/heal/?forceStart=true", cluster.nodes[0].url);
|
let heal_url = format!("{}/rustfs/admin/v3/heal/?forceStart=true", cluster.nodes[0].url);
|
||||||
|
|||||||
Reference in New Issue
Block a user