Skip to content

Commit

Permalink
fix(cli): limit test parallelism on Windows to avoid pipe error
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Mar 7, 2024
1 parent 0fb67ce commit f994f4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cli/lsp/testing/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ impl TestRun {
unreachable!("Should always be Test subcommand.");
};

// TODO(mmastrac): Temporarily limit concurrency in windows testing to avoid named pipe issue:
// *** Unexpected server pipe failure '"\\\\.\\pipe\\deno_pipe_e30f45c9df61b1e4.1198.222\\0"': 3
// This is likely because we're hitting some sort of invisible resource limit
// This limit is both in cli/lsp/testing/execution.rs and cli/tools/test/mod.rs
#[cfg(windows)]
let concurrent_jobs = std::cmp::min(concurrent_jobs, 4);

let (test_event_sender_factory, mut receiver) = create_test_event_channel();
let fail_fast_tracker = FailFastTracker::new(fail_fast);

Expand Down
12 changes: 11 additions & 1 deletion cli/tools/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1192,8 +1192,18 @@ async fn test_specifiers(
})
});

// TODO(mmastrac): Temporarily limit concurrency in windows testing to avoid named pipe issue:
// *** Unexpected server pipe failure '"\\\\.\\pipe\\deno_pipe_e30f45c9df61b1e4.1198.222\\0"': 3
// This is likely because we're hitting some sort of invisible resource limit
// This limit is both in cli/lsp/testing/execution.rs and cli/tools/test/mod.rs
let concurrent = if cfg!(windows) {
std::cmp::min(concurrent_jobs.get(), 4)
} else {
concurrent_jobs.get()
};

let join_stream = stream::iter(join_handles)
.buffer_unordered(concurrent_jobs.get())
.buffer_unordered(concurrent)
.collect::<Vec<Result<Result<(), AnyError>, tokio::task::JoinError>>>();

let handler = spawn(async move { report_tests(receiver, reporter).await.0 });
Expand Down

0 comments on commit f994f4a

Please sign in to comment.