Skip to content
Merged
Show file tree
Hide file tree
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
30 changes: 3 additions & 27 deletions pkgs/id/src/log_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,15 +928,7 @@ mod tests {
}
});
// The first arrival, however it gets here, starts the batch.
let first = loop {
match rx.try_recv() {
Ok(arrival) => break arrival,
Err(mpsc::error::TryRecvError::Empty) => {
std::thread::sleep(Duration::from_millis(1));
}
Err(error) => panic!("the pacer went away: {error}"),
}
};
let first = rx.blocking_recv().expect("the pacer went away");
let batch = collect_batch(first, &mut rx);
pacer.join().unwrap();

Expand All @@ -962,15 +954,7 @@ mod tests {
std::thread::sleep(Duration::from_millis(2));
}
});
let first = loop {
match rx.try_recv() {
Ok(arrival) => break arrival,
Err(mpsc::error::TryRecvError::Empty) => {
std::thread::sleep(Duration::from_millis(1));
}
Err(error) => panic!("the pacer went away: {error}"),
}
};
let first = rx.blocking_recv().expect("the pacer went away");
let batch = collect_batch(first, &mut rx);
pacer.join().unwrap();

Expand Down Expand Up @@ -1031,15 +1015,7 @@ mod tests {
std::thread::sleep(Duration::from_millis(2));
}
});
let first = loop {
match rx.try_recv() {
Ok(arrival) => break arrival,
Err(mpsc::error::TryRecvError::Empty) => {
std::thread::sleep(Duration::from_millis(1));
}
Err(error) => panic!("the pacer went away: {error}"),
}
};
let first = rx.blocking_recv().expect("the pacer went away");
let started = std::time::Instant::now();
let batch = collect_batch(first, &mut rx);
let elapsed = started.elapsed();
Expand Down
6 changes: 3 additions & 3 deletions pkgs/id/src/meta_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ pub fn expect_ok(resp: MetaResponse) -> Result<MetaResponse> {
/// limit instead. Any other read failure passes through unchanged.
pub fn capped_response_error(err: ReadToEndError) -> anyhow::Error {
match err {
ReadToEndError::TooLong => anyhow::anyhow!(
"response too large: exceeds the {MAX_RESPONSE_BYTES}-byte limit"
),
ReadToEndError::TooLong => {
anyhow::anyhow!("response too large: exceeds the {MAX_RESPONSE_BYTES}-byte limit")
}
other => other.into(),
}
}
Expand Down
9 changes: 8 additions & 1 deletion pkgs/id/src/world_doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,14 @@ mod tests {
let _ = std::fs::create_dir_all(dir.join("targets/wasm32"));
let _ = std::fs::write(dir.join("platform.roc"), "platform");
let _ = std::fs::write(dir.join("targets/wasm32/host.wasm"), "wasm");
let roc = crate::world_compile::locate_roc().ok();
let roc_path = dir.join("roc");
let _ = std::fs::write(&roc_path, "roc binary");
#[cfg(unix)]
let _ = std::fs::set_permissions(
&roc_path,
std::os::unix::fs::PermissionsExt::from_mode(0o755),
);
let roc = Some(roc_path.to_string_lossy().into_owned());
let roc_resolved = roc
.clone()
.map(Ok)
Expand Down
Loading