This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new cd112108ec test(core/behavior): poll remove_all directory removal for
COS consistency (#8751)
cd112108ec is described below
commit cd112108ecf3ff522e8bf477607aa8f75a0b2e49
Author: Xuanwo <[email protected]>
AuthorDate: Mon Nov 23 07:36:24 2026 +0800
test(core/behavior): poll remove_all directory removal for COS consistency
(#8751)
---
core/tests/behavior/async_delete.rs | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/core/tests/behavior/async_delete.rs
b/core/tests/behavior/async_delete.rs
index c7d3f25e90..559c7a38c3 100644
--- a/core/tests/behavior/async_delete.rs
+++ b/core/tests/behavior/async_delete.rs
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
+use std::time::Duration;
+
use anyhow::Result;
use futures::TryStreamExt;
use opendal::layers::CapabilityOverrideLayer;
@@ -223,10 +225,17 @@ pub async fn test_remove_all_basic(op: Operator) ->
Result<()> {
assert!(op.exists(&directory).await?, "{directory} should exist");
op.remove_all(&directory).await?;
- assert!(
- !op.exists(&directory).await?,
- "{directory} should be removed"
- );
+ // COS ListObjects is eventually consistent after deletes, so the removed
+ // directory can stay visible to existence checks that list its prefix.
+ // See apache/opendal#7502.
+ let deadline = tokio::time::Instant::now() + Duration::from_secs(5);
+ while op.exists(&directory).await? {
+ assert!(
+ tokio::time::Instant::now() < deadline,
+ "{directory} should be removed"
+ );
+ tokio::time::sleep(Duration::from_millis(250)).await;
+ }
for path in descendants {
assert!(!op.exists(&path).await?, "{path} should be removed");
}