diff --git a/pkgs/id/src/log_sync.rs b/pkgs/id/src/log_sync.rs index 3f78fc3c3f..7c68faeda4 100644 --- a/pkgs/id/src/log_sync.rs +++ b/pkgs/id/src/log_sync.rs @@ -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(); @@ -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(); @@ -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(); diff --git a/pkgs/id/src/meta_client.rs b/pkgs/id/src/meta_client.rs index 9faadc0aac..3cce77d766 100644 --- a/pkgs/id/src/meta_client.rs +++ b/pkgs/id/src/meta_client.rs @@ -53,9 +53,9 @@ pub fn expect_ok(resp: MetaResponse) -> Result { /// 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(), } } diff --git a/pkgs/id/src/world_doctor.rs b/pkgs/id/src/world_doctor.rs index 0f577c4b2b..54391d3fff 100644 --- a/pkgs/id/src/world_doctor.rs +++ b/pkgs/id/src/world_doctor.rs @@ -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)