From dffbe8289d54efdeb625053e2900631a84e19cf0 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 19 Sep 2023 14:37:18 +0800 Subject: [PATCH 1/3] fix(tests): Allow retry more times to make gdrive happy Signed-off-by: Xuanwo --- core/tests/behavior/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tests/behavior/utils.rs b/core/tests/behavior/utils.rs index b5bd0970d871..c9c9a24e39f8 100644 --- a/core/tests/behavior/utils.rs +++ b/core/tests/behavior/utils.rs @@ -85,7 +85,7 @@ pub fn init_service() -> Option { let mut op = op .layer(LoggingLayer::default().with_backtrace_output(true)) .layer(TimeoutLayer::new()) - .layer(RetryLayer::new()) + .layer(RetryLayer::new().with_max_times(4)) .finish(); if !op.info().full_capability().blocking { From 9830d27c9c1e5e7a42de1bc7893e5a31e87b0bfe Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 19 Sep 2023 15:01:53 +0800 Subject: [PATCH 2/3] Don't create file at the same time Signed-off-by: Xuanwo --- core/tests/behavior/list.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/core/tests/behavior/list.rs b/core/tests/behavior/list.rs index 492b3c7caf5d..9f8b4488443c 100644 --- a/core/tests/behavior/list.rs +++ b/core/tests/behavior/list.rs @@ -183,18 +183,10 @@ pub async fn test_list_rich_dir(op: Operator) -> Result<()> { .map(|num| format!("test_list_rich_dir/file-{num}")) .collect(); - expected - .iter() - .map(|v| async { - op.write(v, "test_list_rich_dir") - .await - .expect("create must succeed"); - }) - // Collect into a FuturesUnordered. - .collect::>() - // Collect to consume all features. - .collect::>() - .await; + for path in expected.iter() { + op.write(&format!("test_list_rich_dir/{path}"), "test_list_rich_dir") + .await?; + } let mut objects = op.with_limit(10).lister("test_list_rich_dir/").await?; let mut actual = vec![]; From c02898af08605c85fd6c83e52f16a7d198384ced Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 19 Sep 2023 15:07:14 +0800 Subject: [PATCH 3/3] Fix test Signed-off-by: Xuanwo --- core/tests/behavior/list.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/tests/behavior/list.rs b/core/tests/behavior/list.rs index 9f8b4488443c..65ac1b013b2e 100644 --- a/core/tests/behavior/list.rs +++ b/core/tests/behavior/list.rs @@ -184,8 +184,7 @@ pub async fn test_list_rich_dir(op: Operator) -> Result<()> { .collect(); for path in expected.iter() { - op.write(&format!("test_list_rich_dir/{path}"), "test_list_rich_dir") - .await?; + op.write(path, "test_list_rich_dir").await?; } let mut objects = op.with_limit(10).lister("test_list_rich_dir/").await?;