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/10/26 20:08:45 UTC

(opendal-yinyang) branch xuanwo/managed-sync-regressions updated: test: allow first-run materialization in the rename interleave

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

Xuanwo pushed a commit to branch xuanwo/managed-sync-regressions
in repository https://gitbox.apache.org/repos/asf/opendal-yinyang.git


The following commit(s) were added to refs/heads/xuanwo/managed-sync-regressions by this push:
     new acbc288  test: allow first-run materialization in the rename interleave
acbc288 is described below

commit acbc2882dd925f78c2f1b6875858a886f2d3eef1
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Tue Oct 27 04:08:39 2026 +0800

    test: allow first-run materialization in the rename interleave
    
    A legal run may converge the moved subtree within its first pass, so the namespace-only rename regression no longer forces local v1 or in_sync=false after run one. It requires the retained remote v2, no conflicts, and in_sync only implying identical real trees; only a surviving local v1 must additionally keep the unobserved content pending and out of sync. The reopened finite run and final no-op stability assertions are unchanged.
    
    Co-authored-by: Chojan Shang <ps...@apache.org>
---
 tests/directory_sync.rs | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/tests/directory_sync.rs b/tests/directory_sync.rs
index 3d68458..1e45fe9 100644
--- a/tests/directory_sync.rs
+++ b/tests/directory_sync.rs
@@ -931,22 +931,27 @@ async fn namespace_only_rename_receipt_keeps_interleaved_content() {
         },
         "the namespace rename receipt must not swallow the interleaved external content"
     );
-    assert_eq!(
-        local1["moved/file"],
-        TreeEntry::File {
-            executable: false,
-            bytes: b"v1".to_vec(),
-        },
-        "the local v1 must stay untouched until the next run materializes v2"
-    );
     assert!(
         !outcome1.in_sync || local1 == remote1,
         "in_sync must imply identical real trees"
     );
-    assert!(
-        !outcome1.in_sync,
-        "the unobserved remote v2 must stay pending behind the rename receipt"
-    );
+    // The first run may materialize the retained v2 immediately; only when the
+    // local v1 survives it must the unobserved content stay pending.
+    if local1.get("moved/file")
+        == Some(&TreeEntry::File {
+            executable: false,
+            bytes: b"v1".to_vec(),
+        })
+    {
+        assert!(
+            outcome1.pending > 0,
+            "a surviving local v1 must keep the unobserved remote v2 pending"
+        );
+        assert!(
+            !outcome1.in_sync,
+            "a surviving local v1 must not report in sync"
+        );
+    }
 
     // A reopened sync materializes the retained v2 and then runs stable.
     drop(sync);