Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
akoshelev committed Dec 20, 2024
1 parent b104be2 commit e1b8ffc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
19 changes: 10 additions & 9 deletions ipa-core/src/bin/report_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ async fn main() -> Result<(), Box<dyn Error>> {
panic!("Either --url-file-list or --enc-input-file1, --enc-input-file2, and --enc-input-file3 must be provided");
}
},
// encrypted_inputs,
count.try_into().expect("u32 should fit into usize"),
set_fixed_polling_ms,
)
Expand All @@ -318,7 +317,7 @@ fn inputs_from_url_file(
let mut file = BufReader::new(File::open(url_file_path)?);
let mut buf = String::new();
let mut inputs = [Vec::new(), Vec::new(), Vec::new()];
for (helper_id, helper_input) in inputs.iter_mut().enumerate() {
for helper_input in inputs.iter_mut() {
for _ in 0..shard_count {
buf.clear();
if file.read_line(&mut buf)? == 0 {
Expand All @@ -327,13 +326,15 @@ fn inputs_from_url_file(
helper_input
.push(Uri::try_from(buf.trim()).map_err(|e| format!("Invalid URL {buf:?}: {e}"))?);
}
if helper_input.len() != shard_count {
return Err(format!(
"Helper {helper_id} does not have enough input. Expected {shard_count}, got {}",
helper_input.len()
)
.into());
}
}

// make sure all helpers have the expected number of inputs (one per shard)
let all_rows = inputs.iter().map(|v| v.len()).sum::<usize>();
if all_rows != 3 * shard_count {
return Err(format!(
"The number of URLs in {url_file_path:?} '{all_rows}' is less than 3*{shard_count}."
)
.into());
}

let [h1, h2, h3] = inputs;
Expand Down
3 changes: 1 addition & 2 deletions ipa-core/tests/hybrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ fn test_hybrid_poll() {
])
.silent();

let _server_handle = command.spawn().unwrap();
let _server_handle = command.spawn().unwrap().terminate_on_drop();

// Run Hybrid
let mut command = Command::new(TEST_RC_BIN);
Expand Down Expand Up @@ -348,7 +348,6 @@ fn create_upload_file<const SHARDS: usize>(

// update manifest file
for (path, mut file) in files {
// let path = path.strip_prefix(dest_dir).unwrap().to_str().unwrap();
file.flush()?;
let path = path.file_name().and_then(|p| p.to_str()).unwrap();
writeln!(metadata_file, "http://localhost:{port}/{path}")?;
Expand Down

0 comments on commit e1b8ffc

Please sign in to comment.