feat(infra): temp IdeA généralisé à tous les agents + purge du store managed-tmp au shutdown d'IdeA — #200 (QA verte)
This commit is contained in:
@ -173,3 +173,43 @@ async fn handle_collision_does_not_reuse_existing_allocation() {
|
||||
|
||||
let _ = tokio::fs::remove_dir_all(app_data).await;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn purge_all_deletes_active_allocations_eagerly() {
|
||||
let app_data = temp_app_data("purge-all");
|
||||
let store = FsManagedTempStore::new(&app_data);
|
||||
|
||||
store
|
||||
.allocate(allocation(
|
||||
handle("purge_dir"),
|
||||
ManagedTempKind::Directory,
|
||||
"dir",
|
||||
1_000,
|
||||
None,
|
||||
))
|
||||
.await
|
||||
.unwrap();
|
||||
store
|
||||
.allocate(allocation(
|
||||
handle("purge_file"),
|
||||
ManagedTempKind::File,
|
||||
"file",
|
||||
1_000,
|
||||
None,
|
||||
))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let report = store.purge_all().await.unwrap();
|
||||
|
||||
assert_eq!(report.deleted, 2);
|
||||
assert!(tokio::fs::metadata(store.root().join("purge_dir"))
|
||||
.await
|
||||
.is_err());
|
||||
assert!(tokio::fs::metadata(store.root().join("purge_file"))
|
||||
.await
|
||||
.is_err());
|
||||
assert_eq!(store.purge_all().await.unwrap().deleted, 0);
|
||||
|
||||
let _ = tokio::fs::remove_dir_all(app_data).await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user