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:
2026-08-15 00:14:25 +02:00
parent e6f6eb5b1b
commit b5653b24b5
10 changed files with 271 additions and 14 deletions

View File

@ -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;
}