Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dantengsky committed Dec 18, 2023
1 parent 6b1b015 commit e5782df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/query/ee/tests/it/storages/fuse/operations/vacuum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,19 @@ async fn test_fuse_do_vacuum_drop_table_deletion_error() -> Result<()> {
.options
.insert(OPT_KEY_DATABASE_ID.to_owned(), "1".to_owned());

// mocked accessor that will fail to delete dir/files
use test_accessor::AccessorFaultyDeletion;
// Operator with mocked accessor that will fail on `remove_all`
//
// Note that:
// In real case, `Accessor::batch` will be called (instead of Accessor::delete)
// but all that we need here is let Operator::remove_all failed
let faulty_accessor = std::sync::Arc::new(AccessorFaultyDeletion::new());
let operator = OperatorBuilder::new(faulty_accessor.clone()).finish();

let result = do_vacuum_drop_table(&table_info, &operator, None).await;
assert!(result.is_err());
// verify that accessor.delete() was called
//
assert!(faulty_accessor.hit_delete_operation());

Ok(())
Expand Down

0 comments on commit e5782df

Please sign in to comment.