mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 08:38:58 +00:00
test(ilm): cover restart cancel readback (#5316)
* test(ilm): cover restart cancel readback Co-Authored-By: heihutu <heihutu@gmail.com> * style(ilm): format restart cancel e2e Co-Authored-By: heihutu <heihutu@gmail.com> --------- Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -1910,6 +1910,25 @@ async fn four_node_manual_transition_job_status_survives_node_restart() -> TestR
|
||||
assert_eq!(after_restart["bucket"].as_str(), Some(bucket.as_str()));
|
||||
assert_eq!(after_restart["dry_run"].as_bool(), Some(true));
|
||||
|
||||
let job_endpoint = format!("/rustfs/admin/v3/ilm/transition/jobs/{job_id}");
|
||||
let (cancel_status, cancel_body) =
|
||||
signed_admin_request(&hot.nodes[3].url, Method::DELETE, &job_endpoint, None, &hot.access_key, &hot.secret_key).await?;
|
||||
assert_eq!(
|
||||
cancel_status,
|
||||
StatusCode::OK,
|
||||
"terminal manual transition job cancel after restart failed: {}",
|
||||
compact_body(&cancel_body)
|
||||
);
|
||||
let cancel_value: serde_json::Value = serde_json::from_str(&cancel_body)?;
|
||||
assert_eq!(
|
||||
cancel_value["status"], after_restart["status"],
|
||||
"terminal status changed after restart cancel"
|
||||
);
|
||||
assert_eq!(cancel_value["job_id"].as_str(), Some(job_id.as_str()));
|
||||
assert_eq!(cancel_value["bucket"].as_str(), Some(bucket.as_str()));
|
||||
assert_eq!(cancel_value["dry_run"].as_bool(), Some(true));
|
||||
assert_eq!(cancel_value["cancel_requested"].as_bool(), Some(true));
|
||||
|
||||
let missing_job_id = Uuid::new_v4();
|
||||
let (missing_status, missing_body) = signed_admin_request(
|
||||
&hot.nodes[3].url,
|
||||
|
||||
Reference in New Issue
Block a user