Page MenuHomePhabricator

D4633.id14962.diff
No OneTemporary

D4633.id14962.diff

diff --git a/services/commtest/tests/backup_performance_test.rs b/services/commtest/tests/backup_performance_test.rs
--- a/services/commtest/tests/backup_performance_test.rs
+++ b/services/commtest/tests/backup_performance_test.rs
@@ -4,6 +4,8 @@
mod backup_utils;
#[path = "./backup/create_new_backup.rs"]
mod create_new_backup;
+#[path = "./backup/send_log.rs"]
+mod send_log;
#[path = "./lib/tools.rs"]
mod tools;
@@ -128,6 +130,54 @@
});
// SEND LOG
+ rt.block_on(async {
+ println!("performing SEND LOG operations");
+ let mut handlers = vec![];
+ let (sender, receiver) = channel::<(usize, usize, String)>();
+ for (backup_index, backup_item) in backup_data.iter().enumerate() {
+ let backup_item_cloned = backup_item.clone();
+ for log_index in 0..backup_item_cloned.log_items.len() {
+ let backup_item_recloned = backup_item_cloned.clone();
+ let mut client_cloned = client.clone();
+ let sender_cloned = sender.clone();
+ handlers.push(tokio::spawn(async move {
+ println!("sending log {}/{}", backup_index, log_index);
+ let id = send_log::run(
+ &mut client_cloned,
+ &backup_item_recloned,
+ log_index,
+ )
+ .await
+ .unwrap();
+ assert!(!id.is_empty(), "log id should not be empty after sending");
+ sender_cloned.send((backup_index, log_index, id)).unwrap();
+ }));
+ }
+ }
+ drop(sender);
+
+ for handler in handlers {
+ handler.await.unwrap();
+ }
+ for data in receiver {
+ println!("received: {:?}", data);
+ let (backup_index, log_index, id) = data;
+ backup_data[backup_index].log_items[log_index].id = id;
+ }
+ });
+
+ // check if log IDs are properly set
+ for (backup_index, backup_item) in backup_data.iter().enumerate() {
+ for (log_index, log_item) in backup_item.log_items.iter().enumerate() {
+ assert!(
+ !log_item.id.is_empty(),
+ "missing log id for backup index {} and log index {}",
+ backup_index,
+ log_index
+ );
+ }
+ }
+
// ADD ATTACHMENTS
// PULL BACKUP
})

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 9:07 PM (21 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2689091
Default Alt Text
D4633.id14962.diff (2 KB)

Event Timeline