Skip to content

Commit

Permalink
fix(tests): Create test files one by one instead of concurrently (apa…
Browse files Browse the repository at this point in the history
…che#3132)

* fix(tests): Allow retry more times to make gdrive happy

Signed-off-by: Xuanwo <[email protected]>

* Don't create file at the same time

Signed-off-by: Xuanwo <[email protected]>

* Fix test

Signed-off-by: Xuanwo <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored and Young-Flash committed Sep 19, 2023
1 parent c01781d commit bfe43e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions core/tests/behavior/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,9 @@ 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::<FuturesUnordered<_>>()
// Collect to consume all features.
.collect::<Vec<_>>()
.await;
for path in expected.iter() {
op.write(path, "test_list_rich_dir").await?;
}

let mut objects = op.with_limit(10).lister("test_list_rich_dir/").await?;
let mut actual = vec![];
Expand Down
2 changes: 1 addition & 1 deletion core/tests/behavior/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub fn init_service<B: Builder>() -> Option<Operator> {
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 {
Expand Down

0 comments on commit bfe43e3

Please sign in to comment.