You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2026/05/11 11:37:57 UTC

(opendal) 01/01: test(services/cos): skip create dir list checks

This is an automated email from the ASF dual-hosted git repository.

Xuanwo pushed a commit to branch xuanwo/skip-cos-create-dir-list-test
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 42cc11c0ecec85ef12e67b0e9d602d43eee9df9c
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Mon May 11 19:37:41 2026 +0800

    test(services/cos): skip create dir list checks
---
 core/tests/behavior/async_list.rs | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/core/tests/behavior/async_list.rs b/core/tests/behavior/async_list.rs
index 2a911ff74..ec622b08f 100644
--- a/core/tests/behavior/async_list.rs
+++ b/core/tests/behavior/async_list.rs
@@ -60,6 +60,16 @@ pub fn tests(op: &Operator, tests: &mut Vec<Trial>) {
     }
 }
 
+fn skip_cos_create_dir_list_check(_op: &Operator) -> bool {
+    #[cfg(feature = "services-cos")]
+    if _op.info().scheme() == services::COS_SCHEME {
+        // COS ListObjects is eventually consistent after PUT. See apache/opendal#7502.
+        return true;
+    }
+
+    false
+}
+
 /// Check should be OK.
 pub async fn test_check(op: Operator) -> Result<()> {
     op.check().await.expect("operator check is ok");
@@ -115,6 +125,9 @@ pub async fn test_list_rich_dir(op: Operator) -> Result<()> {
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
     // Gdrive think that this test is an abuse of their service and redirect us
     // to an infinite loop. Let's ignore this test for gdrive.
     #[cfg(feature = "services-gdrive")]
@@ -151,6 +164,9 @@ pub async fn test_list_empty_dir(op: Operator) -> Result<()> {
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
     let dir = format!("{}/", uuid::Uuid::new_v4());
 
     op.create_dir(&dir).await.expect("write must succeed");
@@ -246,6 +262,9 @@ pub async fn test_list_sub_dir(op: Operator) -> Result<()> {
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
     let path = format!("{}/", uuid::Uuid::new_v4());
 
     op.create_dir(&path).await.expect("create must succeed");
@@ -277,6 +296,9 @@ pub async fn test_list_nested_dir(op: Operator) -> Result<()> {
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
     let parent = format!("{}/", uuid::Uuid::new_v4());
     op.create_dir(&parent)
         .await
@@ -433,6 +455,9 @@ pub async fn test_list_root_with_recursive(op: Operator) -> Result<()> {
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
 
     op.create_dir("/").await?;
 
@@ -454,6 +479,9 @@ pub async fn test_list_dir_with_recursive(op: Operator) -> Result<()> {
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
     let parent = uuid::Uuid::new_v4().to_string();
 
     let paths = [
@@ -495,6 +523,9 @@ pub async fn test_list_dir_with_recursive_no_trailing_slash(op: Operator) -> Res
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
     let parent = uuid::Uuid::new_v4().to_string();
 
     let paths = [
@@ -567,6 +598,9 @@ pub async fn test_remove_all(op: Operator) -> Result<()> {
     if !op.info().full_capability().create_dir {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
     let parent = uuid::Uuid::new_v4().to_string();
 
     let expected = [
@@ -687,6 +721,9 @@ pub async fn test_list_with_versions_and_limit(op: Operator) -> Result<()> {
     if !op.info().full_capability().list_with_versions {
         return Ok(());
     }
+    if skip_cos_create_dir_list_check(&op) {
+        return Ok(());
+    }
 
     let parent = "test_list_with_version_and_limit/";
     op.create_dir(parent).await?;