Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/tests/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::harness::{
use crate::cleanup::{CleanupSummary, Task, reconcile_orphaned_storage};
use crate::db::{StorageLocation, now_ms, uploads};
use crate::error::{Failure, Result};
use crate::storage::{AuthorizedUpload, CreatedUpload};
use crate::storage::{AuthorizedUpload, CreatedUpload, EndPosition, RangeRequest, StartPosition};

const DAY_MS: i64 = 24 * 60 * 60 * 1000;

Expand Down Expand Up @@ -216,8 +216,19 @@ async fn part_cleanup_waits_for_an_active_parts_download() {
)
.await;
let storage = server.storage();
// Ranged, and opened before the Merge can finish, so it reads the Parts on every backend.
let reading_parts = storage
.download(
&location.id,
Some(RangeRequest {
start: StartPosition::Index(0),
end: EndPosition::LastByte,
}),
)
.await
.unwrap()
.unwrap();
let merging = storage.download(&location.id, None).await.unwrap().unwrap();
let reading_parts = storage.download(&location.id, None).await.unwrap().unwrap();
read_all(merging.stream).await.unwrap();
storage.wait_for_ongoing_merges().await;

Expand Down