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 19:49:17 UTC

(opendal-yinyang) branch xuanwo/managed-sync-acceptance updated: test: cover conflict export boundaries

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

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


The following commit(s) were added to refs/heads/xuanwo/managed-sync-acceptance by this push:
     new dafa0c5  test: cover conflict export boundaries
dafa0c5 is described below

commit dafa0c502eacf9c96a525edc3e26c108df0af6a5
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Tue Oct 27 03:49:10 2026 +0800

    test: cover conflict export boundaries
    
    Co-authored-by: Chojan Shang <ps...@apache.org>
---
 tests/linux_sync/acceptance.rs | 14 ++++++++++++++
 tests/linux_sync/harness.rs    | 21 +++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/tests/linux_sync/acceptance.rs b/tests/linux_sync/acceptance.rs
index 0e69e82..139cd21 100644
--- a/tests/linux_sync/acceptance.rs
+++ b/tests/linux_sync/acceptance.rs
@@ -303,6 +303,20 @@ fn managed_sync_content_conflicts_export_and_explicit_resolution_both_authoritie
         assert_eq!(repeated_entry.desired_path, conflict.desired_path);
         assert_eq!(remote_file_bytes(&fixture, "shared.txt"), b"left");
 
+        let sentinel = fixture.path("conflict-sentinel");
+        write_local(&sentinel, b"sentinel-bytes");
+        let failed = fixture.sync_export_conflict_output(&right, &conflict.id, "local", &sentinel);
+        assert_failure(&failed, "conflict export over an existing output path");
+        assert_eq!(fs::read(&sentinel).unwrap(), b"sentinel-bytes");
+
+        if publication == Publication::Service {
+            let offline_local = fixture.path("content-local-offline");
+            fixture.stop_service();
+            fixture.sync_export_conflict(&right, &conflict.id, "local", &offline_local);
+            assert_eq!(fs::read(&offline_local).unwrap(), b"right");
+            fixture.restart_service();
+        }
+
         let local_export = fixture.path("content-local");
         let remote_export = fixture.path("content-remote");
         fixture.sync_export_conflict(&right, &conflict.id, "local", &local_export);
diff --git a/tests/linux_sync/harness.rs b/tests/linux_sync/harness.rs
index 9ba76e8..6da45ee 100644
--- a/tests/linux_sync/harness.rs
+++ b/tests/linux_sync/harness.rs
@@ -709,6 +709,27 @@ impl Fixture {
         ]);
     }
 
+    pub fn sync_export_conflict_output(
+        &self,
+        paths: &SyncPaths,
+        conflict: &str,
+        side: &str,
+        output: &Path,
+    ) -> Captured {
+        self.yy(&[
+            "--volume",
+            text(&paths.config),
+            "sync",
+            "export",
+            "--conflict",
+            conflict,
+            "--side",
+            side,
+            "--output",
+            text(output),
+        ])
+    }
+
     pub fn sync_export_artifact(&self, paths: &SyncPaths, artifact: &str, output: &Path) {
         self.yy_ok(&[
             "--volume",