1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

chore: Disable part of parallel serve test on macos (flaky) (#25057)

MacOS tends to not distribute evenly, so just don't assert that requests
were served by > 1 worker on mac.

Also added a check that all workers start, so we at least check that on
macos.
This commit is contained in:
Nathan Whitaker 2024-08-15 14:48:35 -07:00 committed by GitHub
parent 2bb013f9ba
commit a58494483a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -229,6 +229,19 @@ async fn deno_serve_parallel() {
"4" "4"
); );
// make sure all workers have at least started
let mut started = [false; 4];
let start_regex =
Regex::new(r"\[serve\-worker\-(\d+)\s*\] starting serve").unwrap();
for capture in start_regex.captures_iter(&output) {
if let Some(worker_number) =
capture.get(1).and_then(|m| m.as_str().parse::<u32>().ok())
{
started[worker_number as usize] = true;
}
}
assert!(started.iter().all(|&b| b));
for capture in serve_regex.captures_iter(&output) { for capture in serve_regex.captures_iter(&output) {
if let Some(worker_number) = if let Some(worker_number) =
capture.get(1).and_then(|m| m.as_str().parse::<u32>().ok()) capture.get(1).and_then(|m| m.as_str().parse::<u32>().ok())
@ -237,6 +250,7 @@ async fn deno_serve_parallel() {
} }
} }
#[cfg(not(target_vendor = "apple"))] // FIXME: flaky on macOS, it tends to not distribute requests evenly
assert!( assert!(
serve_counts.values().filter(|&&n| n > 2).count() >= 2, serve_counts.values().filter(|&&n| n > 2).count() >= 2,
"bad {serve_counts:?}" "bad {serve_counts:?}"