Update test

This commit is contained in:
Mubelotix
2025-07-22 15:18:13 +02:00
parent 6394efc4c2
commit c1aa4120ac

View File

@ -221,7 +221,7 @@ async fn snapshotception_issue_4653() {
"enqueuedAt": "[date]" "enqueuedAt": "[date]"
} }
"###); "###);
let task = server.wait_task(task.uid()).await.succeeded(); server.wait_task(task.uid()).await.succeeded();
let temp = tempfile::tempdir().unwrap(); let temp = tempfile::tempdir().unwrap();
let snapshot_path = snapshot_dir.path().to_owned().join("db.snapshot"); let snapshot_path = snapshot_dir.path().to_owned().join("db.snapshot");
@ -229,16 +229,22 @@ async fn snapshotception_issue_4653() {
let options = Opt { import_snapshot: Some(snapshot_path), ..default_settings(temp.path()) }; let options = Opt { import_snapshot: Some(snapshot_path), ..default_settings(temp.path()) };
let snapshot_server = Server::new_with_options(options).await.unwrap(); let snapshot_server = Server::new_with_options(options).await.unwrap();
// The snapshot creation task should NOT be spawned => task queue is empty // The snapshot creation task should NOT be spawned again => task is succeeded
let (tasks, code) = snapshot_server.tasks().await; let (task, code) = snapshot_server.get_task(task.uid()).await;
snapshot!(code, @"200 OK"); snapshot!(code, @"200 OK");
snapshot!(tasks, @r#" snapshot!(json_string!(task, { ".enqueuedAt" => "[date]" }), @r#"
{ {
"results": [], "uid": 0,
"total": 0, "batchUid": 0,
"limit": 20, "indexUid": null,
"from": null, "status": "succeeded",
"next": null "type": "snapshotCreation",
"canceledBy": null,
"error": null,
"duration": null,
"enqueuedAt": "[date]",
"startedAt": null,
"finishedAt": null
} }
"#); "#);
} }