mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-16 09:58:21 +00:00
fix(quota): isolate tests and box object futures
This commit is contained in:
@@ -4770,9 +4770,10 @@ mod tests {
|
||||
#[tokio::test]
|
||||
#[serial_test::serial(body_cache_hook)]
|
||||
async fn select_snapshot_rejects_latest_versioned_delete_marker_during_prepare() {
|
||||
let (_first_dirs, first_set) = make_local_set_disks(4, 2).await;
|
||||
let (_second_dirs, second_set) = make_local_set_disks(4, 2).await;
|
||||
let store = new_prepared_reader_test_store(&[Arc::clone(&first_set), Arc::clone(&second_set)]).await;
|
||||
let ctx = Arc::new(crate::runtime::instance::InstanceContext::new());
|
||||
let (_first_dirs, first_set) = make_local_set_disks_with_ctx(4, 2, Arc::clone(&ctx)).await;
|
||||
let (_second_dirs, second_set) = make_local_set_disks_with_ctx(4, 2, Arc::clone(&ctx)).await;
|
||||
let store = new_prepared_reader_test_store_with_ctx(&[Arc::clone(&first_set), Arc::clone(&second_set)], ctx).await;
|
||||
let bucket = "select-snapshot-latest-delete-marker";
|
||||
let object = "versioned-object.bin";
|
||||
let versioned_opts = ObjectOptions {
|
||||
|
||||
@@ -6556,9 +6556,16 @@ impl DefaultObjectUsecase {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn execute_get_object(
|
||||
&self,
|
||||
req: S3Request<GetObjectInput>,
|
||||
) -> std::pin::Pin<Box<dyn std::future::Future<Output = S3Result<S3Response<GetObjectOutput>>> + Send + '_>> {
|
||||
Box::pin(self.execute_get_object_inner(req))
|
||||
}
|
||||
|
||||
#[instrument(level = "trace", skip(self, req))]
|
||||
#[hotpath::measure(impl_type = "DefaultObjectUsecase")]
|
||||
pub async fn execute_get_object(&self, req: S3Request<GetObjectInput>) -> S3Result<S3Response<GetObjectOutput>> {
|
||||
async fn execute_get_object_inner(&self, req: S3Request<GetObjectInput>) -> S3Result<S3Response<GetObjectOutput>> {
|
||||
if let Some(context) = &self.context {
|
||||
let _ = context.object_store();
|
||||
}
|
||||
@@ -7012,8 +7019,15 @@ impl DefaultObjectUsecase {
|
||||
result
|
||||
}
|
||||
|
||||
pub fn execute_copy_object(
|
||||
&self,
|
||||
req: S3Request<CopyObjectInput>,
|
||||
) -> std::pin::Pin<Box<dyn std::future::Future<Output = S3Result<S3Response<CopyObjectOutput>>> + Send + '_>> {
|
||||
Box::pin(self.execute_copy_object_inner(req))
|
||||
}
|
||||
|
||||
#[instrument(level = "debug", skip(self, req))]
|
||||
pub async fn execute_copy_object(&self, req: S3Request<CopyObjectInput>) -> S3Result<S3Response<CopyObjectOutput>> {
|
||||
async fn execute_copy_object_inner(&self, req: S3Request<CopyObjectInput>) -> S3Result<S3Response<CopyObjectOutput>> {
|
||||
if let Some(context) = &self.context {
|
||||
let _ = context.object_store();
|
||||
}
|
||||
@@ -16423,8 +16437,12 @@ mod tests {
|
||||
.expect("create self-copy test bucket");
|
||||
let payload = b"object whose key equals its bucket".to_vec();
|
||||
let mut reader = PutObjReader::from_vec(payload.clone());
|
||||
let setup_opts = ObjectOptions {
|
||||
no_lock: true,
|
||||
..Default::default()
|
||||
};
|
||||
store
|
||||
.put_object(&bucket, &bucket, &mut reader, &ObjectOptions::default())
|
||||
.put_object(&bucket, &bucket, &mut reader, &setup_opts)
|
||||
.await
|
||||
.expect("put object whose key equals its bucket");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user