fix: large file test case

This commit is contained in:
Fu Zi Xiang 2024-01-12 17:59:25 +08:00
parent 615b402782
commit 0f4d4e4b3c
No known key found for this signature in database
2 changed files with 14 additions and 14 deletions

View File

@ -1096,7 +1096,7 @@ impl Client {
.send() .send()
.await?; .await?;
log_request_id(&resp); log_request_id(&resp);
Ok(()) AppResponse::<()>::from_response(resp).await?.into_error()
} }
/// Only expose this method for testing /// Only expose this method for testing

View File

@ -42,19 +42,19 @@ async fn put_and_get() {
} }
// TODO: fix inconsistent behavior due to different error handling with nginx // TODO: fix inconsistent behavior due to different error handling with nginx
// #[tokio::test] #[tokio::test]
// async fn put_giant_file() { async fn put_giant_file() {
// let (c1, _user1) = generate_unique_registered_user_client().await; let (c1, _user1) = generate_unique_registered_user_client().await;
// let workspace_id = workspace_id_from_client(&c1).await; let workspace_id = workspace_id_from_client(&c1).await;
// let mime = mime::TEXT_PLAIN_UTF_8; let mime = mime::TEXT_PLAIN_UTF_8;
// let file_id = uuid::Uuid::new_v4().to_string(); let file_id = uuid::Uuid::new_v4().to_string();
//
// let url = c1.get_blob_url(&workspace_id, &file_id); let url = c1.get_blob_url(&workspace_id, &file_id);
// let data = vec![0; 10 * 1024 * 1024 * 1024]; let data = vec![0; 10 * 1024 * 1024 * 1024];
// let error = c1.put_blob(&url, data, &mime).await.unwrap_err(); let error = c1.put_blob(&url, data, &mime).await.unwrap_err();
//
// assert_eq!(error.code, ErrorCode::PayloadTooLarge); assert_eq!(error.code, ErrorCode::PayloadTooLarge);
// } }
#[tokio::test] #[tokio::test]
async fn put_and_put_and_get() { async fn put_and_put_and_get() {