Page MenuHomePhabricator

D4376.id13884.diff
No OneTemporary

D4376.id13884.diff

diff --git a/services/commtest/tests/backup/pull_backup.rs b/services/commtest/tests/backup/pull_backup.rs
--- a/services/commtest/tests/backup/pull_backup.rs
+++ b/services/commtest/tests/backup/pull_backup.rs
@@ -7,6 +7,7 @@
use crate::backup_utils::{
proto::pull_backup_response::Data, proto::pull_backup_response::Data::*,
+ proto::pull_backup_response::Identity, proto::pull_backup_response::Identity::*,
proto::PullBackupRequest, BackupServiceClient,
};
@@ -45,7 +46,18 @@
let mut current_id: String = String::new();
while let Some(response) = inbound.message().await? {
let response_data: Option<Data> = response.data;
- let id = response.id;
+ let identity: Option<Identity> = response.identity;
+ let mut backup_id: Option<String> = None;
+ let mut log_id: Option<String> = None;
+ match identity {
+ Some(BackupId(bid)) => {
+ backup_id = Some(bid)
+ },
+ Some(LogId(lid)) => {
+ log_id = Some(lid)
+ },
+ None => {},
+ };
match response_data {
Some(CompactionChunk(chunk)) => {
assert!(
@@ -53,7 +65,7 @@
"invalid state, expected compaction, got {:?}",
state
);
- current_id = id;
+ current_id = backup_id.expect("backup id expected but not received");
println!(
"compaction (id {}), pushing chunk (size: {})",
current_id,
@@ -66,11 +78,12 @@
state = State::Log;
}
assert!(state == State::Log, "invalid state, expected compaction");
- if id != current_id {
+ let log_id = log_id.expect("log id expected but not received");
+ if log_id != current_id {
result
.log_items
- .push(Item::new(id.clone(), Vec::new(), Vec::new()));
- current_id = id.clone();
+ .push(Item::new(log_id.clone(), Vec::new(), Vec::new()));
+ current_id = log_id;
}
let log_items_size = result.log_items.len() - 1;
result.log_items[log_items_size]

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 5:12 AM (18 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2684283
Default Alt Text
D4376.id13884.diff (2 KB)

Event Timeline