-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): run test modules in parallel #9815
feat(cli): run test modules in parallel #9815
Conversation
6f92263
to
aec16f9
Compare
aec16f9
to
c14a1c0
Compare
0199aaa
to
84f2e76
Compare
This comment has been minimized.
This comment has been minimized.
2cc1141
to
7601e72
Compare
7601e72
to
0d0f3a2
Compare
I've noticed two quirks that I'm not sure how big of an impact they'll have:
I don't mind it, but maybe we could change it to |
This suggests each module is being type checked individually. AFAIK this is way slower than type-checking them all at once. cc @kitsonk |
Doing the type checking and compilation before attempting to run is intentional.
Yeah by one literally takes hours in the debug build @lucacasonato, but I do them all in one graph.
I've got a branch with slightly nicer test output to address that after this. |
Ran into some caching issues after introducing the fake module stub that calls
Also a few runs definitively used old cached versions of "$deno$test.ts" from disk. |
This reverts commit 5b3ebe0.
a28d05d
to
49ac699
Compare
let join_handles = test_modules.iter().map(move |main_module| { | ||
let program_state = program_state.clone(); | ||
let main_module = main_module.clone(); | ||
let test_module = test_module.clone(); | ||
let permissions = permissions.clone(); | ||
let sender = sender.clone(); | ||
|
||
tokio::task::spawn_blocking(move || { | ||
let join_handle = std::thread::spawn(move || { | ||
let future = run_test_file( | ||
program_state, | ||
main_module, | ||
test_module, | ||
permissions, | ||
sender, | ||
); | ||
|
||
tokio_util::run_basic(future) | ||
}); | ||
|
||
join_handle.join().unwrap() | ||
}) | ||
}); | ||
|
||
let join_futures = stream::iter(join_handles) | ||
.buffer_unordered(concurrent_jobs) | ||
.collect::<Vec<Result<Result<(), AnyError>, tokio::task::JoinError>>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piscisaureus please take a look at this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 thank you Casper, this is a great feature to have
This runs test modules in parallel when the number of concurrent jobs passed via
--jobs=<N>
is greater than 1.The default is to run with a limit of 1 to retain backwards compatibility, as not all test suites in the wild are concurrency safe.
Closes #6559
Closes #9284