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:28:54 UTC
(opendal-yinyang) branch xuanwo/managed-sync-acceptance updated: test: report sync output when a fault gate times out
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 65c9481 test: report sync output when a fault gate times out
65c9481 is described below
commit 65c9481dde0296da9fd7be525ffc8c0186e2cb44
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Tue Oct 27 03:28:48 2026 +0800
test: report sync output when a fault gate times out
Co-authored-by: Chojan Shang <ps...@apache.org>
---
tests/linux_sync/acceptance.rs | 25 +++++++++++++++++++++++--
tests/linux_sync/harness.rs | 9 +++++----
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/tests/linux_sync/acceptance.rs b/tests/linux_sync/acceptance.rs
index a8db1c3..4e93708 100644
--- a/tests/linux_sync/acceptance.rs
+++ b/tests/linux_sync/acceptance.rs
@@ -49,6 +49,15 @@ fn assert_failure(output: &Captured, context: &str) {
);
}
+fn captured_text(output: &Captured) -> String {
+ format!(
+ "status: {}\nstdout:\n{}\nstderr:\n{}",
+ output.status,
+ String::from_utf8_lossy(&output.stdout),
+ String::from_utf8_lossy(&output.stderr)
+ )
+}
+
fn assert_tree(root: &Path, expected: &Tree, context: &str) {
let actual = local_tree(root).unwrap_or_else(|error| {
panic!("scan local tree {} for {context}: {error}", root.display())
@@ -403,7 +412,13 @@ fn managed_sync_completion_race_and_unknown_retry_use_real_service_processes() {
write_local(&client.directory.join("race.txt"), b"local-v1");
let running = fixture.spawn_sync_run(&client);
- gate.wait_for_commit_response(Duration::from_secs(120));
+ if let Err(error) = gate.wait_for_commit_response(Duration::from_secs(120)) {
+ let output = running.wait(Duration::from_secs(130));
+ panic!(
+ "gate did not observe the v1 commit response ({error}):\n{}",
+ captured_text(&output)
+ );
+ }
let v1_version = fixture.remote_file_version("race.txt");
assert_eq!(v1_version.0, base_version.0);
assert!(v1_version.1 > base_version.1, "{v1_version:?}");
@@ -460,7 +475,13 @@ fn managed_sync_completion_race_and_unknown_retry_use_real_service_processes() {
write_local(&client.directory.join("unknown.txt"), b"exactly-once");
let running = fixture.spawn_sync_run(&client);
- gate.wait_for_commit_response(Duration::from_secs(120));
+ if let Err(error) = gate.wait_for_commit_response(Duration::from_secs(120)) {
+ let output = running.wait(Duration::from_secs(130));
+ panic!(
+ "gate did not observe the unknown-outcome commit response ({error}):\n{}",
+ captured_text(&output)
+ );
+ }
let output = running.wait(Duration::from_secs(120));
assert_failure(&output, "sync with a lost commit response");
diff --git a/tests/linux_sync/harness.rs b/tests/linux_sync/harness.rs
index 20fe9eb..f8678e0 100644
--- a/tests/linux_sync/harness.rs
+++ b/tests/linux_sync/harness.rs
@@ -1159,10 +1159,11 @@ impl ServiceGate {
self.address
}
- pub fn wait_for_commit_response(&self, timeout: Duration) {
- self.ready
- .recv_timeout(timeout)
- .expect("Managed Sync gate did not observe a commit response");
+ pub fn wait_for_commit_response(
+ &self,
+ timeout: Duration,
+ ) -> Result<(), mpsc::RecvTimeoutError> {
+ self.ready.recv_timeout(timeout)
}
pub fn release(&self) {